Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
"be consistent"
 
PerlMonks  

cgi redirect

by chuleto1 (Beadle)
on Jul 31, 2003 at 14:27 UTC ( [id://279705]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

chuleto1 has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks:
I am having problems redirecting using the CGI module
$q = new CGI; $q->redirect( -location=>"train1.htm");
This is not working for me. Any hints?
Thank you,
Arturo Ordaz

Replies are listed 'Best First'.
Re: cgi redirect
by blokhead (Monsignor) on Jul 31, 2003 at 14:30 UTC
    The redirect method simply returns the text of the redirect header, you still have to print it!
    print $q->redirect("train1.htm");
    Also be sure that no other headers (Content-type, etc) are printed before this line.

    blokhead

      Guh... I remember making that very mistake just a month ago. So aggravating, and so embarassing when I realized that that was the problem...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://279705]
Approved by blue_cowdawg
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.