For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > November 2006 > Headers("Location") in Perl??









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Headers("Location") in Perl??
Richard Bagshaw

2006-11-04, 6:55 pm

Hi Peeps,



This may be an obvious question but I am new to perl and I need some
advice. Basically I have written a script that makes some changes to a
database when a drop down is selected, after this is done I then want to
goto another page in my system. In php I could use the
header("Location: www.blah.com") todo this, is there anything like that
in perl?



Thx



Richard




David Dorward

2006-11-04, 6:55 pm

On Sat, Nov 04, 2006 at 11:12:51PM -0000, Richard Bagshaw wrote:
> This may be an obvious question but I am new to perl and I need some
> advice. Basically I have written a script that makes some changes to a
> database when a drop down is selected, after this is done I then want to
> goto another page in my system. In php I could use the
> header("Location: www.blah.com") todo this, is there anything like that
> in perl?


You can just print them directly (since CGI expects headers followed
by a blank line followed by message), or CGI.pm has a header method.

--
David Dorward http://dorward.me.uk

???

2006-11-06, 7:55 am

In php header("Location: www.blah.com") will goto http://www.blah.com.
And in Perl CGI, you will use this script, please do not print any header
information

use CGI;
my $cgi = new CGI;
$cgi-> redirect('http://www.blah.com');

--
I want a job about Perl, please visit my resume at
http://wanmyome.googlepages.com/resume.html
""Richard Bagshaw"" <richard@bagshaw.co.uk>
?????? :B2E42FE5AB3A2B4380D0935A4E4CFD971E6F7F@
exch-be06.exchange.local...
Hi Peeps,



This may be an obvious question but I am new to perl and I need some
advice. Basically I have written a script that makes some changes to a
database when a drop down is selected, after this is done I then want to
goto another page in my system. In php I could use the
header("Location: www.blah.com") todo this, is there anything like that
in perl?



Thx



Richard





Íò³¯Î°

2006-11-06, 7:55 am

sorry, i forget print it

print $cgi->redirect('...');


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com