Check if the domain name exists
Published on 10/18/2008 by Dotnetindex|
Vote this tutorial:
|
More articles in PHP
This simple code checks that domain name exist. Only enter any URL in variable $URL and run php code.
<?php
$URL = "http://www.dotnetindex.com/articles/5261-Article--AJAX-Tips-and-Tricks.asp";
$PARSED_URL = parse_url($URL);
$DOMAIN = $PARSED_URL['host'];
$ip = gethostbyname($DOMAIN);
if($ip===$DOMAIN)
{
echo "Url does not exist";
}
else
{
echo "Url exists";
}
?>
no comments submitted
Latest Posts
- Database driven web counter with PHP/mySQL
- PHP mail() function
- Workingwith Arrays in PHP
- Check if the domain name exists
- Generating random strings within PHP
- Encode/Decode an ISO-8859-1 string to UTF-8
- Creating error pages using .htaccess
- PHP Security
- Displaying mySQL table structures in PHP
- Capitilize strings in PHP
- Counting records in PHP mySQL
- Parsing XML/RSS feeds easily with SimpleXML
- Sending queries to mySQL
- Session in PHP
- MD5 Encryption in PHP
- PHP Functions array fill
- How to display date time in real time
- PHP Functions urlencode
- In Case You Missed ItThe Week of January 23 2006
- In Case You Missed ItThe Week of January 16 2006


