jasonc Posted May 30, 2010 Share Posted May 30, 2010 I have tried variouos method from & to & and even placingf it in a string but can not seem to get the & in the URL so it validates with w3.org $ampersand = "&"; header("Location: index.php?" . $gets . $ampersand . "phpsession=" . $phpsession); what is the correct method to add a & in the URL Link to comment https://forums.phpfreaks.com/topic/203355-unable-to-use-in-url-in-header/ Share on other sites More sharing options...
Pikachu2000 Posted May 30, 2010 Share Posted May 30, 2010 What do you mean"so it validates with w3c"? How are you attempting to do that, and what, if any error are you getting? Link to comment https://forums.phpfreaks.com/topic/203355-unable-to-use-in-url-in-header/#findComment-1065374 Share on other sites More sharing options...
teamatomic Posted May 30, 2010 Share Posted May 30, 2010 Try: header("Location: index.php?$gets&phpsession=$phpsession"); HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/203355-unable-to-use-in-url-in-header/#findComment-1065392 Share on other sites More sharing options...
pornophobic Posted May 30, 2010 Share Posted May 30, 2010 PHP has a few functions built in for this. Did you try urlencode() OR, htmlentities() I'm pretty sure one of those converts & to & Also, if you're using it for a location header I don't think you need it to be encoded. :s Link to comment https://forums.phpfreaks.com/topic/203355-unable-to-use-in-url-in-header/#findComment-1065466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.