Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading http: file with CGI 1

Status
Not open for further replies.

webscripter

Programmer
Jul 29, 2002
266
0
0
US
Hi everyone

Does anyone know if it's possible to read the html for a page on another server with http? Is there a CGI method? Thanks
Tricia
yorkeylady@earthlink.net
 
I don't really understand what you're looking for. I have some experience with opening files in CGI, and i'm curious as to why you would want to open html files with it. Is it for a server script or what?

if you reply with a bit more info i'll try to help better.
 
Code:
#!/usr/local/bin/perl
use LWP::Simple;
use strict;
my $url = '[URL unfurl="true"]www.perl.com';[/URL]
$page_content = get($url); # retrieve the page at that url

If you want a little more control over the http request, check out the rest of LWP's tricks.

perldoc LWP
or,
'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
The users of my program have the option of putting their pages and images on my server for a fee.

But the program is free if they use their own server. When they put my program into demo mode to adjust their settings, I would like them to view their own page from their server.

At this point in time, I have some demo files on my server they use. But ultimately I would like to be able to read their pages via http, output the html code for their page in an perl file which detects the my programs code and replaces it with the appropriate info.

Anyone know how to do this? Thanks
Tricia
yorkeylady@earthlink.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top