Home: Perl Programming Help: Beginner:
Website Access



fridge
Novice

Feb 8, 2004, 4:44 PM


Views: 5563
Website Access

I was just wondering if anyone could help me a bit. I have an address stored in a varyable called $address, and i want to display this site on the users screen. Sound pretty simple, but i dont just want the location of the persons browser changed to the new site, I want the site displayed, not redirected.

If anyone could help, i'd be really happy.
-Mitch


WP
Novice

Feb 9, 2004, 10:44 AM


Views: 5560
Re: [fridge] Website Access

It is simple =)

Code
print "Content-type: text/html\n\n"; 
print $address;




Regards,
Paul Wilson
Wilson Programming
http://wilsonprograms.com/


fridge
Novice

Feb 9, 2004, 9:46 PM


Views: 5552
Re: [fridge] Website Access

i dont want the site's address displayed, but the actual site displayed ( but not redirected). so if www.google.com is stored in the $address varyable, the google search engine page will be displayed, but it still be "masked" as the url of my perl script. I hope you get what I mean.


pu_nk
journeyman

Feb 9, 2004, 10:30 PM


Views: 5550
Re: [fridge] Website Access

WHat about a simple FRAME in HTML?

make the top frame like 1% of the page and the bottom frame about 99% of the page.. so it looks like they are on YOUR site but meanwhile browsing outside your site.

Wink


fridge
Novice

Feb 9, 2004, 10:35 PM


Views: 5547
Re: [fridge] Website Access

I dont want to use frames, because they are kinda being phased out by the W3C. They did this by making the target="" tag obselete in XHTML1.0Strict, but thanks anyway.

I sort of want the server to find the website stored in $address, and print its html on the page of my perl script.


WP
Novice

Feb 10, 2004, 2:25 AM


Views: 5541
Re: [fridge] Website Access

You probably need LWP::UserAgent then to fetch the page and print it.



Regards,
Paul Wilson
Wilson Programming
http://wilsonprograms.com/


fridge
Novice

Feb 10, 2004, 3:53 PM


Views: 5537
Re: [fridge] Website Access

Thanks...sounds exactly what i need...but could you please elaborate on that?


fridge
Novice

Feb 10, 2004, 5:15 PM


Views: 5534
Re: [fridge] Website Access

Could anyone elaborate on that...I realy suck at perl...I pretty much need the whole damn thing explained to me.


davorg
Thaumaturge / Moderator

Feb 10, 2004, 11:14 PM


Views: 5531
Re: [fridge] Website Access


Code
use LWP::Simple; 
use CGI 'header';

print header;
getprint $address;


--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


fridge
Novice

Feb 12, 2004, 4:13 PM


Views: 5521
Re: [fridge] Website Access

From research on the internet I have come up with the following code, but when i tried it on my server I got the 'Internal Server Error':

Code
#!/usr/local/bin/perl 



use CGI qw/header/;
use LWP::Simple;
print header();
getprint('http://www.google.com');

Could anyone tell me why?
PS I only used google as an example.


davorg
Thaumaturge / Moderator

Feb 13, 2004, 2:47 AM


Views: 5514
Re: [fridge] Website Access

Like all "internal server error" errors, it's impossible to know what has gone wrong without looking in the web server error log. What does it say in there?

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


fridge
Novice

Feb 15, 2004, 4:02 PM


Views: 5504
Re: [fridge] Website Access

Thanks Dave,
I checked the server log, and found out (to my disgust) that those modules aren't supported by my server. Is there anyway to manualy include the module source or somthing?


davorg
Thaumaturge / Moderator

Feb 17, 2004, 12:57 AM


Views: 5497
Re: [fridge] Website Access

CGI has been included with the standard Perl distribution since 1997 (version 5.004_04). LWP::Simple has been included since 2002 (version 5.8.0). If you don't have those modules then your Perl installation is either rather old or very broken. In both cases I suggest you either reinstall or upgrade your version of Perl or your ISP.

If there is some reason why you can't do that, then look at the section "How do I keep my own module/library directory?" in perlfaq8.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks