note 84618 rejected from function.exec by mgf
| From: | mgf@php.net | Date: | Thu, 24 Jul 2008 13:27:28 +0000 |
| Subject: | note 84618 rejected from function.exec by mgf | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142648@lists.php.net to get a copy of this message | ||
Note Submitter: kooladiey at gmail dot com
----
<?php
public function executeUrl()
{
$website = $this->getRequestParameter("Url");
$p = parse_url($website);
$scheme = parse_url($p['scheme']);
//if ($scheme != 'http' || $scheme != 'HTTP' || $scheme != 'https' ||
$scheme != 'HTTPS')
if($scheme =='')
{
$Url = 'http://'+$Url;
}
$t = "has address";
$host = "host ".$Url;
$res = exec($host);
$pos = (strpos($res,$t));
if($pos !== false)
{
$correct = true;
echo "true|X|$Url";
}
else
{
$correct = false;
echo "false|X|$Url";
}
return sfView::NONE;
}
}
?>
I want to make the code work properly as i need to check for a valid domain name, this is done
through Ajax and problem in code is with the code above as the code is not giving a proper output.
please help me regarding the same....