Re: urldecode & header

From: Date: Wed, 05 Sep 2007 04:54:24 +0000
Subject: Re: urldecode & header
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-261713@lists.php.net to get a copy of this message
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/

« previous php.general (#261713) next »