perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: Posting data when redirecting to a page
Date Wed, 01 Jan 2003 20:18:08 GMT
>
> I have a beginner's question.
>
> I'm trying to redirect the program flow to another .htm page using
> $http_headers_out{Location} but I also want to pass a message ($msg) to
the
> new page using POST method.
>
> [-
> $msg = "Error saving data #53: really really long explanation....";
> $http_headers_out{Location}="acc_admin.htm";
> exit;
> -]
>
> What's the best way to do that?
>

You can't do a POST request as an redirect, but you can do a GET to pass the
data
[-
$r = shift ;
$http_headers_out{Location}="acc_admin.htm?msg=" . $r -> Escape ($msg, 2) ;

The Escape makes sure you don't get trouble with any special chars inside
the url

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message