Re: urldecode & header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 4 Sep 2007, alexus wrote:
> i have a form that user suppose to fill out that then get submitted to
> index.php (current setup)
>
> now what i need is another let's say index2.php that would take
> everything from that form, rewrite one of the field and spits it back
> to index.php
>
> now, i dont know but as far as i know stuff that form spits out is
> urlencoded, so i need to use urldecode function (
> http://us.php.net/urldecode ) to decode and then header function (
> http://us2.php.net/header ) to spit it back to index.php

urlencode() and urldecode() are handy for passing text in urls.

In index.php you would have something like:

$msg = urlencode( 'whatever message you want to send' );

header( "Location: http://example.com/index2.php?msg=$msg"; );
exit;

Then on the index2.php

$msg = isset( $_REQUEST[ 'msg' ] ) ? urldecode( $_REQUEST[ 'msg' ] ) : '';

At this point you can mangle $msg however you like and send it somewhere
else with another header() call.



-- 
Greg Donald
Cyberfusion Consulting
http://cyberfusionconsulting.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux