Sorry nnichols I was having a bit of trouble seeing how I would fit this into my script (Set out below)
#!/usr/local/bin/php4
<html>
<body>
<?php
$link = mysql_pconnect ("", "", "*****")
or die ("Could not connect");
mysql_select_db ("****")
or die ("Could not select database");
$search = $HTTP_POST_VARS['thebox'];
$query = "SELECT last_name, link FROM president WHERE last_name LIKE '%$search%'";
$result = mysql_query ($query)
or die ("Query failed");
if ($myrow = mysql_fetch_array($result)) {
echo "<table border=10>\n";
echo "<tr><td>Name</td></tr>\n";
do {
printf("<tr><td>%s</td></tr>\n", $myrow["last_name"]);
printf("<tr><td>%s</td></tr>\n", $myrow["link"]);
} while ($myrow = mysql_fetch_array($result));
echo "</table>\n";
} else {
echo "Sorry, no records were found!";
}
?>
</body>
</html>
The "link" field obviously is what contains the URL.
Also, could you just explain what you mean by "validate the url" at the moment it is in the table as http://www.website.
Thank you yet again for your kind help.
JD.