On Tue, 2008-09-16 at 18:37 +0100, Nigel Peck wrote:
> Hi all,
>
> I'm missing something here with regards http redirects.
>
> I'm trying to have my script redirect to itself through the browser so that
> the URL changes in the browser.
>
> When I send the headers myself:
>
> print 'Location: ' . $_[0] . "\n";
> print 'Connection: close' . "\n\n";
>
> The redirect works but the web address does not change in the browser. When I
> use:
>
# Get the computer to tell you what's happening
> use CGI.pm;
>
> my $q = new CGI;
>
print $q->header, $q->start_html, $q->p( 'CGI.pm redirect:' ), $q->start_pre;
> print $q->redirect(
> -location => $_[0],
> -status => 301,
> );
print $q->end_pre, $q->end_html;
>
> The redirect works and changes the browser URL.
>
> What is CGI.pm doing differently to me?
>
> I want to do this without using CGI.pm (so I understand what's going on).
>
> Thanks in advance,
> Nigel
>
--
Just my 0.00000002 million dollars worth,
Shawn
"Where there's duct tape, there's hope."
Cross Time Cafe
"Perl is the duct tape of the Internet."
Hassan Schroeder, Sun's first webmaster
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/