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?
Printable View
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?
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.
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:
But thanks for your suggestion!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;