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 Need PHP "fetch a web page" script

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-18-2005, 06:48 PM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Feb 2005
Posts: 343
dabb is on a distinguished road
 



Need PHP "fetch a web page" script


Can somebody point me to a PHP script or code snippet that will let me fetch a web page using GET or POST methods? I'd be happy to donate some NP$ to the person who steers me to what I need.

Thanks!
dabb is offline  
Old 05-18-2005, 06:55 PM   #2 (permalink)
NamePros Member
Join Date: Nov 2003
Location: Ontario, Canada
Posts: 127
eagle12 will become famous soon enougheagle12 will become famous soon enough
 



What do you mean by fetch a website?
eagle12 is offline  
Old 05-18-2005, 07:00 PM THREAD STARTER               #3 (permalink)
NamePros Regular
Join Date: Feb 2005
Posts: 343
dabb is on a distinguished road
 



I want to retrieve the HTML of a specified URL. The linux equivalent of:

lynx -source http://www.blah.com/page.html > html.txt
dabb is offline  
Old 05-18-2005, 07:15 PM   #4 (permalink)
NamePros Member
Join Date: Nov 2003
Location: Ontario, Canada
Posts: 127
eagle12 will become famous soon enougheagle12 will become famous soon enough
 



PHP Code:
$contents file_get_contents("http://www.google.ca"); 
????: NamePros.com http://www.namepros.com/programming/91267-need-php-fetch-web-page-script.html
You can replace "http://google.ca" with the form variable.

$_GET['site']
$_POST['site']
eagle12 is offline  
Old 05-19-2005, 12:49 AM   #5 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
be very careful with this as you may make it possible for rogue scripts to be run on your server.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 05-19-2005, 12:27 PM THREAD STARTER               #6 (permalink)
NamePros Regular
Join Date: Feb 2005
Posts: 343
dabb is on a distinguished road
 



Originally Posted by eagle12
PHP Code:
$contents file_get_contents("http://www.google.ca"); 
I should have known PHP would have a single function to do this, thanks! I'm a C guy, but thought I'd do my latest project in PHP to learn the ropes.
????: NamePros.com http://www.namepros.com/showthread.php?t=91267

Thanks again, NP$ sent!
dabb is offline  
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
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 10:09 AM
60.000 Templates, scripts, fonts, banners etc. $9.95 atkims Web Development Wanted 19 11-16-2004 10:48 AM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:21 AM.

Managed Web Hosting by Liquid Web
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