$body "; } function &comment_form($url) { return "
Name:Email:
"; } function my_return_page($body, $url) { $form = comment_form($url); home_page ("Comments on the provided url", "

Comments on the provided url

$body

\"Valid

\"Valid

Back to Index

" ); } include ("mydb.php"); $url = $_GET['url']; // Check the validity of the url-address $pattern = '[http://][a-z1-9]+[.][a-z1-9.:/]+'; if (eregi($pattern, $url)) { //Connect to the DB mydb_connect(); // The select-query $rows = mysql_query ("SELECT * FROM Comments WHERE url = '".$url."'"); $comments = ""; } // Return a page with the comments to the user—the perfect // solution returns a message "no reader comments" if there are // no comments associated with the page if($comments != ""){ my_return_page ($comments, $url); } else{ my_return_page ("

There are no comments to the provided url.

"); } ?>