RESET issue
Posted: Thu May 29, 2003 2:17 pm
Hi guys.
I have a web page that displays all the Items in a catalogue & images. I also have a search button so users can retrive a list of specific items.
the code is as follows
My question is that i need a reset button to effectively get out of the refresh the page as if no search text had been entered i.e. the page loads up showing the first 1 to 5 sale items again.
Any ideas
Cheers
I have a web page that displays all the Items in a catalogue & images. I also have a search button so users can retrive a list of specific items.
the code is as follows
Code: Select all
<?php
echo "<form method=POST'' action=''> ";
echo "Enter Search word then click Search!: <input type='text' name='searchtext'> ";
echo "<input type='SUBMIT' value='Search'> ";
echo "</form> ";
// Connection Details
mysql_connect($host,$username,$password) or die("Cannot connect to the database.<br>" . mysql_error());
mysql_select_db($database) or die("Cannot select the database.<br>" . mysql_error());
if(!isset($page)) {
$page = 0;
}
$limit = 5; // Entries per page
if ( $searchtext == "" ){
$sql = "SELECT SaleNumber,LotNo,Description,LowEst,HighEst,Image FROM $table ORDER BY LotNo LIMIT $page,$limit";
} else {
$sql = "SELECT SaleNumber,LotNo,Description,LowEst,HighEst,Image FROM $table WHERE Description LIKE '%$searchtext%' ORDER BY LotNo LIMIT $page,$limit";
}
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());
// Retrieve Data and output to table etc etc
// Next/Previous page Code
?>Any ideas
Cheers