WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
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 Resources
Web Development Content
Internet Security Software
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
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

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 : 3992
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

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

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>



Proper way to do a header redirection with PHP.
Categories : PHP, Headers, URLs
URL validator and reformatter
Categories : PHP, URLs
PHP function which gets all the data from a webpage into a string, we can perform regular expression functions on that data afterwards to get our desired data.
Categories : PHP, URLs, HTML and PHP
PHP Script to find url links in a page
Categories : PHP, URLs, Regexps, Arrays
Class to Create protected URLs
Categories : PHP, PHP Classes, URLs
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
getting the name of the current script and query string
Categories : PHP, Global Variables, Variables, URLs
PHP5 URL Object
Categories : PHP, PHP Classes, URLs, Strings
Get the self URL of current page
Categories : PHP, URLs, Beginner Guides
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
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
SubmitForce URL power submitter (searchengine submission class)
Categories : PHP, Search Engines, URLs, PHP Classes
rawurldecode -- Decode URL-encoded strings
Categories : PHP, PHP Functions, URLs
pick up an array of variables from a query string such as: http://www.archipro.com/test.php?state=AB&state=BC
Categories : PHP, Strings, URLs, Global Variables