RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

php drop down menu to search multiple sql tables

Join Date: Jul 2005
Posts: 11
Reputation: lawfour is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
lawfour lawfour is offline Offline
Newbie Poster

Re: php drop down menu to search multiple sql tables

  #7  
Jul 28th, 2005
Having trouble connecting, not sure if i am setting up the code right. Below is what I have for search.php.

And I am not sure where this code goes, is it a separate page that give the results of the search?:

<html>

(javascript validation)

<form>
<select><?php echo $list; ?></select>
</form>

</html>

Also, when I do get the search engine working does that mean that I have to change my current index.html to index.php because I want to put the search on the top of my website at http://www.jci.tju.edu/~lwilliam/

With the current code I get this error:

Fatal error: Cannot instantiate non-existent class: myops in /hsphere/local/home/lwilliam/lawfour.com/esr/search.php on line 27





<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SEARCH</title>
<SCRIPT LANGUAGE="javascript">

function validate() {

fm = document.thisForm

//use validation here to make sure the user entered
//the information correctly

fm.submit()

}

</SCRIPT>
</head>

<body>
<?

include ("http://www.lawfour.com/esr/dbconnect.php");

$dbops = New MyOps;
$link = $dbops->dbconnect();
$list = "<option value='CommonEquip'>Common Equip.</option><option value='CommonEquip'>Lab Equip.</option>
<option value='Company'>Vendor</option><option value='Equipment Info'>Pending Repairs</option>
<option value='Parts'>Products</option><option value='Parts'>Parts</option><option value='RTP'>RTP</option>
<option value='Ticket'>Airgas Tickets</option>";

?>

<form name="thisForm" method="POST" action="process.php">




<table width="30%" border="0" cellspacing="0" cellpadding="0">
<tr>


<td width="7%" class="verdana_login">Search:</td>
<td width="8%">
&nbsp;<input type="text" name="my_textbox" size="10">&nbsp;
</td>
<td width="12%">
<select name="my_dropdown">
<option>Airgas Tickets</option>
<option>Products</option>
<option >Pending Repairs</option>
<option selected>Common Equip.</option>
<option >Lab Equip.</option>
<option >Vendors</option>
<option >RTP's</option>

</select>
</td>

<td width="13%" align="center">&nbsp;<INPUT type=image name="btm_submit" src="http://www.lawfour.com/esr/images/go.gif" border="0" width="35" height="22" onclick="validate()"></td>



</table></form>
</body>
</html>
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:21 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC