Good day.
I'm basically new to PHP programming, and I'm getting a grasp. I've been googling anywhere possible but I can't seem to have codes working for me. I have a code and when the form is submitted, it gives off an 'HTTP 403' error. Here's the code:
- <form name="search" method="post" action="$PHP_SELF?">
-
Seach for: <input type="text" name="find" /> in
-
<Select NAME="field">
-
<Option VALUE="fname">First Name</option>
-
<Option VALUE="lname">Last Name</option>
-
<Option VALUE="info">Profile</option>
-
</Select>
-
<input type="hidden" name="searching" value="yes" />
-
<input type="submit" name="search" value="Search" />
-
</form>
-
-
<?
-
if ($searching =="yes")
-
{
-
echo "<h2>Results</h2><p>";
-
-
-
if ($find == "")
-
{
-
echo "<p>You forgot to enter a search term";
-
exit;
-
}
-
-
-
mysql_connect("localhost", "root", "m1ch3ll3") or die(mysql_error());
-
mysql_select_db("sample") or die(mysql_error());
-
-
-
$find = strtoupper($find);
-
$find = strip_tags($find);
-
$find = trim ($find);
-
-
-
$data = mysql_query("SELECT * FROM users WHERE upper($field) LIKE'%$find%'");
-
-
//And we display the results
-
while($result = mysql_fetch_array( $data ))
-
{
-
echo $result['fname'];
-
echo " ";
-
echo $result['lname'];
-
echo "<br>";
-
echo $result['info'];
-
echo "<br>";
-
echo "<br>";
-
}
-
?>
hoping you could help me. thanks.