WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : A function for checking the existence of a URL
Categories : PHP, URLs Click here to Update Your Picture
Joshy Jacob
Date : Aug 23rd 2006
Grade : 4 of 5 (graded 1 times)
Viewed : 2381
File : 4487.php
Images : No Images for this code example.
Search : More code by Joshy Jacob
Action : Grade This Code Example
Tools : My Examples List

 
Like this code?
Show the author your appreciation.
Submit your own code examples 
 

A function for checking the existence of a given URL. The usage of the function is similar to
file_exists. The only parameter of the function is the URL to be verified. The function returns true if the URL exists, else false.

<?php
/*=========================================================================*/
#  A function for checking the existence of a given URL. The usage of the   #
#  function is similar to file_exists. The only parameter of the function   #
#  is the URL to be verified. The function returns true if the URL exists,  #
#  else false.                                                              #
/*=========================================================================*/
function url_exists($url)
{
   
$handle = @fopen($url, "r");
    if (
$handle === false)return false;
   
fclose($handle);
    return
true;
}
$url = isset($_GET['url']) ? $_GET['url'] : 'http://www.weberdev.com/';
?>
<html>
<head>
<title>URL Verification</title>
</head>
<body>
<table style="width:100%;height:100%;">
<tr><td>
<center><form method="get">
<?php
   
if(url_exists($url))
    {
        echo
"<span style='color:green;font:bold 12px Verdana;'>$url is valid.</span><br><br>";
    }else
        {
        echo
"<span style='color:red;font:bold 12px Verdana;'>$url is invalid.</span><br><br>";
    }
?>
<input type="text" name="url" size="35" value="<?php echo $url;?>">&nbsp;&nbsp;<input type="submit" value="Go">
</form>
</center></td></tr></table>
</body>
</html>



PHP Script to find url links in a page
Categories : PHP, URLs, Regexps, Arrays
php jump urls...the best way
Categories : PHP, URLs, Filesystem
Get the self URL of current page
Categories : PHP, URLs, Beginner Guides
SubmitForce URL power submitter (searchengine submission class)
Categories : PHP, Search Engines, URLs, PHP Classes
Link Extractor - This function is used to extract links from a given URL. This will convert relative path into absolute path and also remove PHPSESSID stuff.
Categories : PHP, URLs, Regexps
PHP5 URL Object
Categories : PHP, PHP Classes, URLs, Strings
Class to Create protected URLs
Categories : PHP, PHP Classes, URLs
phpHoo2 (Xhoo using php3/MySQL) is a Yahoo-like link directory. Much like the Open Directory Project (dmoz.org).
Categories : PHP, Complete Programs, Directories, MySQL, URLs
PHPRecommend v1.0 - "Recommend this page to a friend" script written in PHP. Easy to install
Categories : PHP, URLs, Complete Programs, Email, Site Planning
PHPLinkRot v1.0 - program which allows users to report broken links on your website just by clicking a button. Works well on custom 404 pages
Categories : PHP, Complete Programs, Debugging, URLs, Site Planning
Pageinfo: Array containing page URI, page query string (parameters), request method (GET or POST) and the complete URI
Categories : Variables, PHP Options and Info, Arrays, URLs, PHP
valid link!
Categories : HTTP, URLs, PHP
a file explorer for the web, filesystem php php3 files dirs directories pictures files windows linux system list ls scripts
Categories : PHP, URLs, Directories, Filesystem
Gonx URLs - This class is meant to generate URLs for accessing application dynamically generated pages based on parameters passed in the URL.
Categories : PHP, PHP Classes, Navigation, URLs
Remove URL Parameter Substr Strstr
Categories : PHP, URLs, Strings