Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

cgi redirect

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

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 18: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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2023-03-27 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (65 votes). Check out past polls.

    Notices?