[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 05-18-2005, 05:48 PM   #1 (permalink)
NamePros Regular
 
Join Date: Feb 2005
Posts: 343
423.50 NP$ (Donate)

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, 05:55 PM   #2 (permalink)
NamePros Member
 
Join Date: Nov 2003
Location: Ontario, Canada
Posts: 91
80.80 NP$ (Donate)

eagle12 is on a distinguished road


What do you mean by fetch a website?
eagle12 is offline  
Old 05-18-2005, 06:00 PM   #3 (permalink)
NamePros Regular
 
Join Date: Feb 2005
Posts: 343
423.50 NP$ (Donate)

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, 06:15 PM   #4 (permalink)
NamePros Member
 
Join Date: Nov 2003
Location: Ontario, Canada
Posts: 91
80.80 NP$ (Donate)

eagle12 is on a distinguished road


PHP Code:
$contents = file_get_contents("http://www.google.ca");
You can replace "http://google.ca" with the form variable.

$_GET['site']
$_POST['site']
eagle12 is offline  
Old 05-18-2005, 11:49 PM   #5 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

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, 11:27 AM   #6 (permalink)
NamePros Regular
 
Join Date: Feb 2005
Posts: 343
423.50 NP$ (Donate)

dabb is on a distinguished road


Quote:
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.

Thanks again, NP$ sent!
dabb is offline  
Closed Thread


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM
60.000 Templates, scripts, fonts, banners etc. $9.95 atkims Web Development Wanted 19 11-16-2004 09:48 AM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 09:11 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85