WatsonN Posted September 25, 2010 Share Posted September 25, 2010 I'm trying to put a variable in a header("Location: /?p=$url"); Is this even possible? Link to comment https://forums.phpfreaks.com/topic/214360-variable-in-location/ Share on other sites More sharing options...
Alex Posted September 25, 2010 Share Posted September 25, 2010 Did you try it? Link to comment https://forums.phpfreaks.com/topic/214360-variable-in-location/#findComment-1115505 Share on other sites More sharing options...
Pikachu2000 Posted September 25, 2010 Share Posted September 25, 2010 You can use a variable in header(), however the example wouldn't be a valid url as it's written. Link to comment https://forums.phpfreaks.com/topic/214360-variable-in-location/#findComment-1115506 Share on other sites More sharing options...
WatsonN Posted September 25, 2010 Author Share Posted September 25, 2010 I did try it and it sent me to /?p=$url instead of what the variable equals. Link to comment https://forums.phpfreaks.com/topic/214360-variable-in-location/#findComment-1115508 Share on other sites More sharing options...
Alex Posted September 25, 2010 Share Posted September 25, 2010 Then you're probably using single quotes instead of what you posted. You can use a variable in header(), however the example wouldn't be a valid url as it's written. Why not? Link to comment https://forums.phpfreaks.com/topic/214360-variable-in-location/#findComment-1115510 Share on other sites More sharing options...
WatsonN Posted September 25, 2010 Author Share Posted September 25, 2010 AlexWD that was exactly what it was Thanks yall Link to comment https://forums.phpfreaks.com/topic/214360-variable-in-location/#findComment-1115513 Share on other sites More sharing options...
Pikachu2000 Posted September 25, 2010 Share Posted September 25, 2010 Then you're probably using single quotes instead of what you posted. You can use a variable in header(), however the example wouldn't be a valid url as it's written. Why not? Something about it didn't make sense in my mind, but I just tested it and it works; I was wrong. (Stupid mind) Link to comment https://forums.phpfreaks.com/topic/214360-variable-in-location/#findComment-1115527 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.