in reply to Re^6: Coding and Design Advice
in thread Coding and Design Advice
#!/usr/bin/perl use strict; use CGI; my $cgi = new CGI; # construct and send confirmation emails here if you # want them to go to everyone if ($cgi->param('radiobutton') eq 'paypal') { # this sends a redirection header print $cgi->redirect('http://sendmetopaypal.com'); } else { # construct and send confirmation emails here if you # only want them to go to non paypal users print $cgi->header(), $cgi->start_html, "Thank you for booking, a confirmation email has been sent to +email\@address", $cgi->end_html; }
What I meant by 'has to be the first header' is don't do this:
#!/usr/bin/perl use strict; use CGI; my $cgi = new CGI; print $cgi->header; print $cgi->redirect('http://redirecttohere.com');
I've got stuck on that one a couple of times :-) In other words, don't forget that redirect is a header in it's own right - it doesn't need a $cgi->header sending before it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Coding and Design Advice
by b310 (Scribe) on Apr 01, 2005 at 16:51 UTC | |
|
Re^8: Coding and Design Advice
by Anonymous Monk on Apr 01, 2005 at 17:47 UTC | |
by g0n (Priest) on Apr 01, 2005 at 18:28 UTC | |
by b310 (Scribe) on Apr 02, 2005 at 19:55 UTC |