Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Redirection in parl?

by SilverB1rd (Scribe)
on Feb 07, 2001 at 23:39 UTC ( #57024=perlquestion: print w/replies, xml ) Need Help??

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

I'm working on a send mail script and I would like to redirect it to a success page when the email is sent? how can I do this? I tryed to using a small script like this to test it but my server just gave me a internal configuration error message?
#!/usr/bin/perl use CGI; $q = new CGI; print $q->redirect("http://www.mydomain.com");

Replies are listed 'Best First'.
Re: Redirection in parl?
by Fastolfe (Vicar) on Feb 07, 2001 at 23:46 UTC
    The code you gave is fine, so I suspect it is either a permissions or configuration problem.

    Generally when debugging CGI problems it helps to examine the web server's error logs so that you can see what the error message is. Attempting to debug problems like this without having access to error messages will be very difficult (arguably impossible for a novice).

    In a pinch, in the absense of log file access, this could help you considerably:

    use CGI::Carp 'fatalsToBrowser';
Re: Redirection in perl?
by dws (Chancellor) on Feb 07, 2001 at 23:44 UTC
    print "Location: http://www.mydomain.com/\r\n\r\n";
Re: Redirection in parl?
by gryphon (Abbot) on Feb 08, 2001 at 01:06 UTC

    Greetings SilverB1rd,

    You could always try using HTML rather than Perl. I don't know if this will help your situation, but you never know. Try this:

    my $url = 'http://www.mydomain.com'; print "<Meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=$url\">\n\n";

    -Gryphon.

      Thanks guys! the print "Location: http://www.mydomain.com/\r\n\r\n"; works fine for me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://57024]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-12-02 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?