advancedfuture Posted June 16, 2008 Share Posted June 16, 2008 I am trying to insert variables into header() but can't seem to get it working. I've tried the following header( "Location: index.php?c=".$city."&&st=".$state." ); as well as header( "Location: index.php?c=$city&&st=$state" ); both with no such luck... what is the proper syntax for doing this? Quote Link to comment https://forums.phpfreaks.com/topic/110464-solved-how-to-insert-variables-into-header/ Share on other sites More sharing options...
.josh Posted June 16, 2008 Share Posted June 16, 2008 Assuming that $city and $state actually hold something.. header("Location: index.php?c=$city&st=$state"); Quote Link to comment https://forums.phpfreaks.com/topic/110464-solved-how-to-insert-variables-into-header/#findComment-566726 Share on other sites More sharing options...
Jabop Posted June 16, 2008 Share Posted June 16, 2008 Or... header( "Location: index.php?c=".$city."&&st=".$state); Quote Link to comment https://forums.phpfreaks.com/topic/110464-solved-how-to-insert-variables-into-header/#findComment-566730 Share on other sites More sharing options...
advancedfuture Posted June 16, 2008 Author Share Posted June 16, 2008 oops! I see what I did wrong I accidently used $_GET instead of $_POST! THankx! Quote Link to comment https://forums.phpfreaks.com/topic/110464-solved-how-to-insert-variables-into-header/#findComment-566731 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.