 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
priteshloke
Joined: 31 May 2007 Posts: 2 Location: india
|
Posted: Thu May 31, 2007 8:29 am Post subject: problem in validate url |
|
|
Hello
i am trying to validate this url freewebs.com. This url is working but pear validator show me this is not valid url . pls any body tell me the solution ?
Thank you _________________ PML |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 911
|
Posted: Thu May 31, 2007 10:46 am Post subject: |
|
|
| Why don't you show us your code? Otherwise, nobody will be able to tell what you're doing wrong. |
|
| Back to top |
|
 |
priteshloke
Joined: 31 May 2007 Posts: 2 Location: india
|
Posted: Thu May 31, 2007 10:49 am Post subject: problem in validate url |
|
|
function url_checker($url)
{
include_once("Validate.php");
$options = array(
'domain_check' => "true",
'allowed_schemes' => array('http','https'),
'strict' => ';/?:$,'
);
if(Validate::uri($url, $options) == true)
{
//echo "hi";
// create a new curl resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FAILONERROR, 1);
// grab URL
$response = curl_exec ($ch);
// get error code
$curl_errorno = curl_errno($ch);
// close curl resource, and free up system resources
curl_close($ch);
if($curl_errorno == 0)
return true;
else
return false;
}
else
{
return false;
}
} _________________ PML |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 911
|
Posted: Thu May 31, 2007 11:23 am Post subject: |
|
|
| Please use the {code} tag (with square brackets, or use the button above the text input field) to make your code readable. And you didn't show us how (and with what parameter) you call your function. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|