|
-
Nov 20th, 2005, 10:58 PM
#1
Thread Starter
Fanatic Member
Querying Webpage PL/PHP
Say I wanted to do something like the Inet control does in VB6:
Inet1.OpenURL(url as string)
How would one accomplish this in either Perl or PHP? Would you have to open your own connection to the URL and get what is returned?
"X-mas is 24.Desember you English morons.." - NoteMe
-
Nov 21st, 2005, 03:39 AM
#2
Re: Querying Webpage PL/PHP
With PHP, you can supply a http URL in pretty much any place where a file name is wanted, e.g. in fopen(), file_get_contents(), ...
file_get_contents() is the easiest of those, but it needs PHP 4.3 or later.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 21st, 2005, 03:57 PM
#3
Thread Starter
Fanatic Member
Re: Querying Webpage PL/PHP
Alright, while I didn't use PHP this time that will be helpful for the future! What I did was use perl and the following:
PHP Code:
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $QUERY_URL = "http://google.com/movies?sc=1&near=27502&rl=1&tid=ae5bb734333a162c";
my $req = HTTP::Request->new(GET => $QUERY_URL);
$req->header(Accept => 'text/html');
my $res = $ua->request($req);
my $content = $res->content;
But thanks for your suggestion!
"X-mas is 24.Desember you English morons.." - NoteMe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|