sorry - here u go:
<?php
include_once ("../sallysurfconnection/header.html");
$page_title = 'find_customer_results.php';
?>
<!--Space layout image positioning-->
<td colspan="8" valign="top">
<img src="C:\Program Files\EasyPHP1-7\www\Images\1pix.jpg" width="561" height="9">
<h2>Find Customer search results</h2>
<?php
//create short variable names
$searchtype=$POST["searchtype"];
$searchterm=$POST["searchterm"];
$searchterm= trim($searchterm);
if (!$searchtype || !$searchterm)
{
echo '<p><font color="red">You have not entered search details. Please go back and try again.</font></p>';
exit;
}
$searchtype = addslashes($searchtype);
$searchterm = addslashes($searchterm);
@ $db = mysql_pconnect("localhost","Admin","admin");
if (!$db)
{
echo '<p><font color="red">Error: Could not connect to database. Please try again later.</font></p>';
exit;
}
$query = "SELECT * FROM customer_table WHERE ".$searchtype." like '%".$searchterm."%'";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
echo '<P> Number of items found: '.$num_results.'</p>';
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
echo '<p><strong>'.($i+1).'.Surname: ';
echo htmlspecialchars(stripslashes($row['Surname']));
echo '</strong><br />First_Name: ';
echo stripslashes($row['First_Name']);
echo '<p><strong><br />Cust_Id: ';
echo stripslashes($row['Cust_Id']);
echo '</p>';
}
include_once ("../sallysurfconnection/footer.html");
?>
heres the search Form:
<?php
include_once ("../sallysurfconnection/header.html");
$page_title = 'Find_customer.php';
?>
<!--Space layout image positioning-->
<td colspan="8" valign="top">
<img src="C:\Program Files\EasyPHP1-7\www\Images\1pix.jpg" width="561" height="9">
<h2>Customer search</h2>
<form action="find_customer_results.php" method="post">
Enter Search Type:<br />
<select name="searchtype">
<option value="Surname">Surname</option>
<option value="First_Name">First_Name</option>
<option value="Cust_Id">Cust_Id</option>
</select>
<br />
Enter search term:<br />
<input name="searchterm" type="text">
<br />
<input type="submit" value="Search">
</form>
<?php
include_once ("../sallysurfconnection/footer.html");
?>
thanks