|
|
|
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";
}
?> | | |
|
| $REMOTE_HOST does not return a value. Categories : PHP, Global Variables, HTTP | | | Function that does language negotiation based on the Accept-Language header, a cookie or host name Categories : HTTP, PHP, Cookies | | | Remote File Size Categories : PHP, Filesystem, HTTP, Sockets | | | Script to check values being submitted by POST or GET method from a form. This script may help diagnose what variables are being supplied by a browser to other php scripts. Categories : HTML, Variables, Debugging, PHP, HTTP | | | valid link! Categories : HTTP, URLs, PHP | | | The following snippet gives complete info about all submitted
HTTP_POST_VARS and HTTP_GET_VARS Categories : Variables, HTTP, PHP | | | Upload Script, Upload File Script, Input Type="File" Categories : PHP, HTML and PHP, HTTP | | | This script shows you the 7th latest php items from the mailing list archive on zend.com Categories : HTML, HTML and PHP, HTTP, PHP | | | Gonx Proxy - This class is meant to act as an HTTP proxy to serve pages of a remote server as if they were local pages.
Categories : PHP, PHP Classes, HTTP | | | Easy upload class Categories : PHP Classes, Filesystem, HTTP, PHP | | | PHP Domain Availability Checker Categories : PHP, Complete Programs, Regexps, HTTP, Sockets | | | Using cURL to download a file programmatically. Categories : PHP, PHP Extensions, CURL | | | Returns Yahoo! Address Book and Messenger List as an Array Categories : PHP, PHP Classes, CURL | | | Link Manager for Link Exchangers Categories : PHP, PHP Classes, Databases, MySQL, CURL | | | redirect redirection ip address authentication authenticate addr Categories : Authentication, HTTP, Network, PHP | |
|
|