Advertisement
Guest User

demo

a guest
Oct 30th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <html> <head> <title>MrBool Development Article</title> </head> <body> <form action="search.php" method="GET"> <b>Enter Search Term:</b> <input type="text" name="term" size="50"> <b>Results:</b> <select name="results"> <option>10</option> <option>20</option> <option>50</option> </select><br> <input type="submit" value="Search"> </form> <?php mysql_connect("localhost", "USERNAME", "PASSWORD"); mysql_select_db("DATABASE"); $sql = mysql_query("SELECT * FROM searchengine WHERE pagecontent LIKE '%$_GET[term]%' LIMIT 0,$_GET[results]"); while($ser = mysql_fetch_array($sql)) { echo "<h2><a href='$ser[pageurl]'>$ser[pageurl]</a></h2>"; } ?> <hr> <a href="./index.php">Go Back</a> </body> </html>
  2.  
  3. Read more: http://mrbool.com/how-to-create-your-own-search-engine-with-php-and-mysql/25836#ixzz3Hd8oS44J
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement