NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page how do I parse a URL in PHP ?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 01-06-2006, 01:26 PM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Nov 2004
Posts: 55
marcel is an unknown quantity at this point
 



how do I parse a URL in PHP ?


how do I parse a URL in PHP ?
I want to make sure the link is a real website. any known classes for this ?
marcel is offline  
Old 01-06-2006, 04:26 PM   #2 (permalink)
mch
NamePros Regular
Join Date: Nov 2005
Location: EU
Posts: 248
mch is on a distinguished road
 



Try this buddy:
PHP Code:
if (preg_match("/http(s?):\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/\?%&=]*)?/i"$url_to_parse))
????: NamePros.com http://www.namepros.com/programming/154875-how-do-i-parse-url-php.html
{
    
//URL is valid, do stuff

Regex pattern taken from:
http://objectsharp.com/blogs/dave/ar...05/17/446.aspx
mch is offline  
Old 01-12-2006, 03:57 AM   #3 (permalink)
Senior Member
 
eli03's Avatar
Join Date: Oct 2005
Location: HomeinProvence
Posts: 1,562
eli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant futureeli03 has a brilliant future
 


Breast Cancer Breast Cancer
you can also add this function, to know if the site is existing

PHP Code:
function if_url_exist($url) {
    
$fp = @fopen($url,"r");
    if (
$fp) {
        
fclose($fp);
       
$ret ="Y";
    } else {
        
$ret ="N";
    }
    return 
$ret;


//test
$url="http://www.bigvertiser.com";
$test if_url_exist($url);
echo 
$test
eli03 is offline  
Old 01-12-2006, 02:07 PM   #4 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,963
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
There is also parse_url
__________________
NameNewsletter.com - free lists of available domain names
ZoneFiles.net (beta) - ccTLD and gTLD droplists
sdsinc is online now  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Great Scripts for Sale With Resale Rights! Zeeble Scripts For Sale 20 01-04-2006 01:39 AM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM
soooo many yahoo's redhippo Domain Name Discussion 5 07-12-2005 11:26 PM
Parse a URL in PHP to return domain RJ Programming 43 11-12-2004 07:45 AM

 
All times are GMT -7. The time now is 02:05 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger