Page 1 of 1

Passing a variable thru header redirect

Posted: Wed Oct 14, 2009 10:53 pm
by edawson003
How can I get a $variable to pass thru a url set by php redirect code ($recordid for example)?

Code: Select all

 
$recordid = $_GET['fid'];
 
header( "Location: http://www.someurl.com/membersarea/edit.php" );
I want the url to actual work :
http://www.someurl.com/membersarea/edit.php?fid=117

Re: Passing a variable thru header redirect

Posted: Wed Oct 14, 2009 11:10 pm
by Eric!
I usually just redirect directly with the query data in the string.

Code: Select all

header('Location: http://www.someurl.com/membersarea/edit.php?fid='.$recordid);

Re: Passing a variable thru header redirect

Posted: Wed Oct 14, 2009 11:54 pm
by edawson003
That works. Thx! :D