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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Redirect trouble (I DID check the FAQ)



Dec 12, 2000, 2:44 PM

Post #1 of 3 (666 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:

print "Location:\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 = "";
print "location: $url\n\n";


Dec 12, 2000, 3:36 PM

Post #2 of 3 (664 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";


Dec 12, 2000, 4:12 PM

Post #3 of 3 (662 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.



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

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