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:
Redirect trouble (I DID check the FAQ)

 



HR
Novice

Dec 12, 2000, 2:44 PM

Post #1 of 3 (665 views)
Redirect trouble (I DID check the FAQ) Can't Post

Having trouble with redirecting. In a simple script with only these 2 lines of code, it works:

#!/usr/bin/perl
print "Location:http://www.perlguru.com/\n\n";

In the script I really want to use it in, it does not. I am trying to use it to redirect to a particular URL after executing the script. I gave it it's own subroutine and tried the format in the FAQ here. Instead of redirecting you what it does is print out the code

$url = "http://www.perlguru.com";
print "location: $url\n\n";




HR
Novice

Dec 12, 2000, 3:36 PM

Post #2 of 3 (663 views)
Found the problem [In reply to] Can't Post

This seems to be a common mistake. Found the problem by searching comp.lang.perl.misc You can't use the content header line if you want to use location to redirect. Make sure you have not already printed out the line below and it should redirect instead of just printing out the line of code.

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



sleuth
Enthusiast

Dec 12, 2000, 4:12 PM

Post #3 of 3 (661 views)
Re: Found the problem [In reply to] Can't Post

 
Sorry I didn't mention that in the FAQ, I'll go back and add that little note.

Sleuth


 
 


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

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