I'm willing to make the search box in php, in the search box when I input data stored in mysql terms then the stored data above is unique there is not the same and has a length of 1000 characters.
maybe based on unique ip or most recent searches..
How to create a list of 20 searches to eternity or 20 most wanted search?
How do I make result search box like that? is there a tutorial or want to give the file?
-- updated --
php
<?php
/*-----------------------
First part: db connection
-------------------------*/
$dbhost = "localhost";
$dbname = "aa";
$dbuser = "root";
$dbpass = "";
$db=mysql_connect($dbhost, $dbuser, $dbpass);
if ($db==FALSE)
die("Error while connecting to MYSQL ".mysql_error());
mysql_select_db($dbname ,$db);
/*------------------------------
Read and save the search query
-------------------------------*/
$querystat = mysql_real_escape_string($_GET['q']);
$datetime = time();
if( ($_SERVER['HTTP_REFERER'] == '') AND ( ($querystat != $_SESSION['prev_search']) OR ( ($datetime - $_SESSION['datetime']) > 60) ) ) {
$insertquery = "INSERT INTO `query` ( `query` , `datetime`) VALUES ( '$querystat' , '$datetime');";
mysql_query($insertquery, $db);
}
$_SESSION['datetime'] = $datetime;
$_SESSION['prev_search'] = $querystat;
?>
<form method="GET" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
Form:<br>
<input type="text" name="q" value=""><br><br>
<input type="submit" value="Submit">
</form>
here sql
CREATE TABLE `query` (
`id` int(11) NOT NULL,
`query` varchar(255) NOT NULL DEFAULT '',
`datetime` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Please your help.. Sorry my bad english