![]() |
Redirecting URL in Perl
A very common technique used by many developers is to redirect the user to another URL or the referrer URL after doing some work e.g. processing a form. In Perl all headers have to printed before any actual content is outputed.
A very simple way of redirecting to another URL Code: Perl
Doing the same thing using the CGI module. Code: Perl
You may also pass the HTTP status code, sometimes it's needed e.g. if you pass a 302 status code, the URL of the page in the browser remains the same. Here's all the status codes used for redirecting a page. Code:
301 Moved PermanentlyCode: Perl
|
Re: Redirecting URL in Perl
|
Re: Redirecting URL in Perl
nice post
|
Re: Redirecting URL in Perl
print redirect('URL');
will do the same thing |
| All times are GMT +5.5. The time now is 12:02. |