Forum Moderators: coopster & phranque

Message Too Old, No Replies

Simple newbie question

how to get script to jump to another webpage

         

Neorio

6:07 am on Aug 18, 2003 (gmt 0)

10+ Year Member



I've just written a small perl mailer script. After the script mails the administrator the data, I want the script to jump out to another webpage (which shows a thankyou message).

How do you do this in Perl?

myself

6:50 am on Aug 18, 2003 (gmt 0)

10+ Year Member



The simpliest way is to print one line: http-header that will redirect user's browser:

print "Location: [site.some...]

Note that the line befor (as a part of http-header) have to be printed before any output of the script. In our simple case the script should not print something else.

Neorio

7:08 am on Aug 18, 2003 (gmt 0)

10+ Year Member



Cheers, that's saved me a few headaches!

much appreciated.

kroikie

3:32 pm on Aug 28, 2003 (gmt 0)



hi people;
i understand the ans given above and agree with it but if the user were to press or click back what would happen then?

IanKelley

12:54 am on Aug 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Pressing the back button would bring them to the page before the one that did the redirect.

Since the redirect is happening without any output, this would not be a problem.