Creating a Search Application -
(Page 19 of 29 )
Now that we have created the harvesting class, we can code the harvest.php script. This is essentially just an HTML form that posts to back to itself. Because we have placed all the code that does the actual keyword harvesting in a class, this script is clean keeps the presentation separate from the logic.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Harvest Keywords</title> </head> <body> <?php require('harvestclass.php'); if(isset($_POST['submit'])) { $gather = new Harvest_Keywords($_POST['urls']); $gather->process(); echo "Keywords Harvested.<br />\n"; } ?> <h1>Harvest</h1> <p>Enter URLs to harvest keywords from, each on its own line:</p> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><textarea name="urls" cols=50 rows=10></textarea></p> <p><input type="submit" name="submit" value="Submit"></p> </form> </body> </html> |
Next: Searching >>
More Database Articles Articles
More By Matt Wade