Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect 3

Status
Not open for further replies.

mmaz

Programmer
Nov 22, 2000
347
Hi,

How do you redirect a user to another page? In ASP, it would be Response.redirect "
Thanks,

Marie
 
Don't know if it's a generally accepted way of doing it (there's probably a fancier way with a module) but you know how you have to print a mime line before any output to browser, ie "Content-type: text/html\n\n" ? You can say BEFORE that "Location: $url\n\n" where $url would contain the redirect address. Just dump it to standard out so it's the first thing the browser sees. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
If you're using the CGI module (having done [tt]my $cgi = new CGI;[/tt], say) you would do:
[tt]print $cgi->redirect($url);[/tt]

You should not print out any header before or after doing so.

I'm fairly certain that has exactly the same result.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top