PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
problem in validate url

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Validate
View previous topic :: View next topic  
Author Message
priteshloke



Joined: 31 May 2007
Posts: 2
Location: india

PostPosted: Thu May 31, 2007 8:29 am    Post subject: problem in validate url Reply with quote

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
View user's profile Send private message Yahoo Messenger
mark



Joined: 07 Jan 2007
Posts: 1000

PostPosted: Thu May 31, 2007 10:46 am    Post subject: Reply with quote

Why don't you show us your code? Otherwise, nobody will be able to tell what you're doing wrong.
Back to top
View user's profile Send private message
priteshloke



Joined: 31 May 2007
Posts: 2
Location: india

PostPosted: Thu May 31, 2007 10:49 am    Post subject: problem in validate url Reply with quote

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
View user's profile Send private message Yahoo Messenger
mark



Joined: 07 Jan 2007
Posts: 1000

PostPosted: Thu May 31, 2007 11:23 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Validate All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software