Stutterbug and Scott ! ... thanks a lot ... not exactly working ... but i guess we're quite close !
here's my code again ... with my db feeding the info in the box ...
Only trouble here is that i get a lot of "BAD LINK" when there actually good !
so what do you think ?
<?
function checklink($link)
{
//see if we have a link to check
if($link)
{
//open the url
$file = @fopen ("$link", "r");
}
if($file)
{ return true ;
fclose($file);
}
}
function printstatus($link) {
print $link;
if($link !="")
{
//show result if good
if((checklink($link))=="true")
{
echo "<center><b>Good Link </b><br>($link)</center>";
}
else
{
//show result if bad
echo "<center><b>Bad Link </b><br>($link)</center>" ;
}
}
}
$linkarray = split("\n",$HTTP_POST_VARS['link']);
foreach ($linkarray as $linkitem) {
printstatus($linkitem);
flush();
}
?>
</head>
<body>
<form action="index.php" method="post">
<table border="0" align="center">
<tr><td>
<font size="1" face="verdana">
Input Link e.g (<a href="http://blah.com" target="_blank">http://blah.com</a>)
</font>
</td>
</tr>
<tr>
<td>
<textarea name="link" cols="30">
<?
mysql_connect("localhost","*","**");
mysql_select_db("****");
if(!isset($cmd))
{
$result = mysql_query("select adresse FROM repSites");
$count = count($result);
//run the while loop that grabs all the news scripts
while($r=mysql_fetch_array($result))
{
//grab the title and the ID of the news
$adresse=$r["adresse"];//take out the title
//make the title a link = <a href='index.php?cmd=delete&id=$id'>Delete</a>
echo $adresse;
echo "\n";
}
}
?>
</textarea>
</td></tr>
<tr><td>
<input type="submit" value="Check Link"> <input type="reset" value="Reset">
</td></tr>
</table>
</font> </form>
</body>
Capte ! 😕