PHP Classes

File: try.php

Recommend this page to a friend!
  Classes of Craig Heydenburg  >  better_field_search  >  try.php  >  Download  
File: try.php
Role: Example script
Content type: text/plain
Description: first example
Class: better_field_search
Generalized, flexible class to search a mysql DB
Author: By
Last change:
Date: 14 years ago
Size: 1,187 bytes


Class file image Download
This is the simplest example of an implementation of this class
require ("");

// change the information below to your needs
$try=new search_fields("hostname","username","password","databasename");
$cols=array("col1_name","col2_name", "col3_name");

// the stuff below here should not need to be changed to work
if ($submit<>"search") {
<BODY style='font-family:Arial,Helvetica,San-Serif;'>
<form action="<? echo basename($PHP_SELF) ?>" method="post">
I'll search by first name, last name, or city!<BR>
Enter search text: <INPUT TYPE="TEXT" NAME="terms">
<INPUT TYPE="hidden" Name="submit" value="search">
<button type="submit" name="sub_button">Search</button></FORM>

} else {
<HTML><HEAD><TITLE>Search Results</TITLE></HEAD>
<BODY style='font-family:Arial,Helvetica,San-Serif;'>

// Match the keywords and display the result
<BR><BR><A HREF="<? echo basename($PHP_SELF) ?>">Search Again</A>