hi i am trying to make search for items in my database but its not wokring, here is the cod ehtat i have so far
<html>
<head>
<title> Media-O RAMA Catalog Search</title>
</head>
<body
<H1>Media-O RAMA Catalog Search</H1>
<?php
// create short variable names
$searchtype=$HTTP_POST_VARS['searchtype'];
$searchterm=$HTTP_POST_VARS['searchterm'];
$searchterm= trim($searchterm) ;
if (!$searchtype || !$searchterm)
{
echo 'You have not entered search details. Please go back and try again';
exit;
}
$searchtype = addslashes($searchtype);
$searchterm = addslashes($searchtem);
@ $db = mysql_pconnect('localhost','user','pass');
if (!$db)
{
echo 'Error: Could not connect to database. Please go back and try again';
exit;
}
mysql_select_db('booksr');
$query = "select * from booksr where ".$searchtype." like '%".$searchterm."%'";
$result = mysql_query($query);
$num_results = mysql_num_rows_($result);
echo '<p>Number of books found: '.$num_result.'</p>';
for ($i=0; $i <$num_results; $i++);
{
$row = mysql_fetch_array($result);
echo '<p><strong>'. ($i+1).'.Title; ';
echo htmlspecialchars(stripslashes($row['title']));
echo '</strong><br />Author: ';
echo stripslashes($row['author']);
echo '<br />ISBN: ';
echo stripslashes($row['ISBN']);
echo '<br />Price: ';
echo stripslashes($row['price']);
echo '</p>';
}
?>
</body>
</html>
it keeps givng me this error code
Media-O RAMA Catalog Search
Notice: Undefined variable: HTTP_POST_VARS in G:\webclient\xampp\htdocs\web\results.php on line 10
Notice: Undefined variable: HTTP_POST_VARS in G:\webclient\xampp\htdocs\web\results.php on line 11
You have not entered search details. Please go back and try again
any help would be much appreciated