|
|
|
I found this example in the php Manual and made some modifications.
| <?
function url_exists($strURL) {
$resURL = curl_init();
curl_setopt($resURL, CURLOPT_URL, $strURL);
curl_setopt($resURL, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($resURL, CURLOPT_HEADERFUNCTION, 'curlHeaderCallback');
curl_setopt($resURL, CURLOPT_FAILONERROR, 1);
curl_exec ($resURL);
$intReturnCode = curl_getinfo($resURL, CURLINFO_HTTP_CODE);
curl_close ($resURL);
if ($intReturnCode != 200 && $intReturnCode != 302 && $intReturnCode != 304) {
return false;
}Else{
return true ;
}
}
//Usage Example :
If(url_exists("http://www.weberdev.com/addexample.php3")) {
Echo"URL Exists";
}Else{
Echo"URL doesnot exist";
}
?> | | |
|
| Simple Password example Categories : PHP, Authentication, Security, HTTP | | | Newbie Notes #8 - A cron trick Categories : PHP, CURL, Beginner Guides | | | Gets the browser and OS from the $_SERVER['http_user_agent'] variable in PHP Categories : PHP, HTTP, Regexps | | | PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | WebServerSpy checks which kind of Webserver is running, Apache, Netscape, Fasttrack, IIS, HTTP-Header, HTTP 1.0, GET, spy, WWW Categories : HTTP, Network, Apache, PHP, Web Servers | | | Simple pipe delimited file export program that downloads to a local machine Categories : PHP, Filesystem, Databases, MySQL, HTTP | | | Authentication HTTP protocol POST Categories : Authentication, HTTP, PHP | | | Import the yahoo address book. Categories : PHP, CURL, Authentication | | | curl_close -- Close a CURL session Categories : PHP, PHP Functions, CURL | | | This gets the http response headers for a given url and returns them in an assoc array. i.e. to test if a url exists: $array = get_http_headers($url); if($array[result]=200) { } Categories : HTTP, Arrays, PHP | | | These PHP Classes Check if a host is alive using various methods. Categories : PHP, PHP Classes, Sockets, CURL | | | Class that allows the PHP developer to create and manage UNIX like password files suitable for use as Apache authentication password files.
Categories : HTTP, PHP, PHP Classes, Filesystem | | | Yahoo! Messenger Friend List Categories : PHP, CURL, HTML and PHP | | | How to force the user to download a file instead of opening it up in an
controlled environment within the browser (i.e. MS Word/Adobe Acrobat) Categories : Browsers, PHP, HTTP | | | Remote File Saving with PHP - Download and serve a remote file. The content of the file will be updated at fixed intervals. Categories : PHP, Filesystem, Cache, Sockets, HTTP | |
|
|
|