Announcements | Last Post | |
---|---|---|
SoC Curricula | 09/30/2017 01:08PM | |
Demarcation or scoping of examinations and assessment | 02/13/2017 07:59AM | |
School of Computing Short Learning Programmes | 11/24/2014 08:37AM | |
Unisa contact information | 07/28/2011 01:28PM |
Search engine error 403 May 10, 2011 10:34AM |
Registered: 13 years ago Posts: 85 Rating: 0 |
Language: PHP<html> <head> </head> <body> <h2>Search</h2> <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="sname">Last Name</option> <Option VALUE="sno">Profile</option> </Select> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="search" value="Search" /> </form> </body> </html> <?php //If form submitted $searching =';searching';; if ($searching =="yes") { echo "<h2>Results</h2><p>"; //Error if blank if ($find == "") { echo "<p>You forgot to enter a search term"; exit; } //connect to database include ';includes/config.php';; include ';includes/functions.php';; connect(); // filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); // search for term in specified field $data = mysql_query("SELECT * FROM student WHERE upper($field) LIKE';%$find%';"); // display results while($result = mysql_fetch_array( $data )) { echo $result[';fname';]; echo " "; echo $result[';sname';]; echo "<br>"; echo $result[';sno';]; echo "<br>"; echo "<br>"; } //Counts number or results and display message if there we';re non $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query<br><br>"; } //Remind user what was searched for echo "<b>Searched For:</b> " .$find; } ?>
Re: Search engine error 403 May 10, 2011 10:50AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Search engine error 403 May 10, 2011 12:34PM |
Registered: 13 years ago Posts: 25 Rating: 0 |
Re: Search engine error 403 May 10, 2011 01:08PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Search engine error 403 May 10, 2011 02:31PM |
Registered: 13 years ago Posts: 25 Rating: 0 |
Re: Search engine error 403 May 11, 2011 12:12AM |
Registered: 13 years ago Posts: 85 Rating: 0 |