Warning: fsockopen() [function.fsockopen]: unable to connect
Posted: Fri Jan 04, 2008 6:06 pm
I am trying to check if my link is on someones website before adding there link to my website. I get the following error's
Warning: fsockopen() [function.fsockopen]: unable to connect to http://www.thenarutommorpg.com:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /mounted-storage/home60b/sub001/sc18478-RGIJ/thenarutommorpg.com/links.php on line 27
Warning: feof(): supplied argument is not a valid stream resource in /mounted-storage/home60b/sub001/sc18478-RGIJ/thenarutommorpg.com/links.php on line 28
Warning: fsockopen() [function.fsockopen]: unable to connect to http://www.thenarutommorpg.com:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /mounted-storage/home60b/sub001/sc18478-RGIJ/thenarutommorpg.com/links.php on line 27
Warning: feof(): supplied argument is not a valid stream resource in /mounted-storage/home60b/sub001/sc18478-RGIJ/thenarutommorpg.com/links.php on line 28
Code: Select all
if(isset($_POST['Submit']))
{
$title = $_POST['textTitle'];
$url = $_POST['textURL'];
$descr = $_POST['textDESC'];
$return = $_POST['textURL2'];
$fp = fsockopen($return, 80, $errno, $errstr, 30);
while (!feof($fp))
{
$page .= fgets($fp, 128);
}
if(stristr($page, '<a href="http://www.thenarutommorpg.com"') === TRUE)
{
$sql = "INSERT INTO links (url, title, descr, return_url) VALUES ('$url', '$title', '$descr', '$return')";
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not insert link information', '', __LINE__, __FILE__, $sql);
}
$template->assign_vars(array('MESSAGE' => "Your Link has been added."));
}
else
{
$template->assign_vars(array('MESSAGE' => "Our link could not be found on the page you supplied; therefor, your link was not added."));
}
}