CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Website Access

 



fridge
Novice

Feb 8, 2004, 4:44 PM

Post #1 of 13 (1901 views)
Website Access Can't Post

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

Post #2 of 13 (1898 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #3 of 13 (1890 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #4 of 13 (1888 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #5 of 13 (1885 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #6 of 13 (1879 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #7 of 13 (1875 views)
Re: [fridge] Website Access [In reply to] Can't Post

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


fridge
Novice

Feb 10, 2004, 5:15 PM

Post #8 of 13 (1872 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #9 of 13 (1869 views)
Re: [fridge] Website Access [In reply to] Can't Post


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

Post #10 of 13 (1859 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #11 of 13 (1852 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #12 of 13 (1842 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

Post #13 of 13 (1835 views)
Re: [fridge] Website Access [In reply to] Can't Post

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

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives