note 84618 added to function.exec
| From: | kooladiey at gmail dot com | Date: | Tue, 22 Jul 2008 11:50:03 +0000 |
| Subject: | note 84618 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-142485@lists.php.net to get a copy of this message | ||
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....
----
Server IP: 203.199.69.133
Probable Submitter: 122.160.211.2
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- https://master.php.net/note/edit/84618
Del: integrated -- https://master.php.net/note/delete/84618/integrated
Del: useless -- https://master.php.net/note/delete/84618/useless
Del: bad code -- https://master.php.net/note/delete/84618/bad+code
Del: spam -- https://master.php.net/note/delete/84618/spam
Del: non-english -- https://master.php.net/note/delete/84618/non-english
Del: in docs -- https://master.php.net/note/delete/84618/in+docs
Del: other reasons-- https://master.php.net/note/delete/84618
Reject -- https://master.php.net/note/reject/84618
Search -- https://master.php.net/manage/user-notes.php