[PHP] urldecode header

2007-09-04 Thread alexus
hi

i was wondering if someone can give me a hand (i'm very new to php).

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

now after all that i'm pretty much stuck here, i dont know how to do
it.. if someone can a spare a minute or two and write that code for me
i'd highly appreciate that.

thanks in advance

-- 
http://alexus.org/

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



Re: [PHP] urldecode header

2007-09-04 Thread Greg Donald
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