will35010 Posted October 13, 2010 Share Posted October 13, 2010 The org variable holds the value of the folder name. The problem is that the header is sending out ".$org." and not the actual value of $org. Example output url: http://127.0.0.1/application/".$org."/display/trackingboard.php I want this url if the value is test: http://127.0.0.1/application/test/display/trackingboard.php Thanks! $org = "test"; header('Location: ../application/".$org."/display/trackingboard.php'); Link to comment https://forums.phpfreaks.com/topic/215807-variable-inside-header-question/ Share on other sites More sharing options...
GingerRobot Posted October 13, 2010 Share Posted October 13, 2010 The problem is that you've opened your string with single quotes and closed it with doubles. Try: header('Location: ../application/'.$org.'/display/trackingboard.php'); Link to comment https://forums.phpfreaks.com/topic/215807-variable-inside-header-question/#findComment-1121893 Share on other sites More sharing options...
Philip Posted October 13, 2010 Share Posted October 13, 2010 header('Location: ../application/".$org."/display/trackingboard.php'); should read: header('Location: ../application/'.$org.'/display/trackingboard.php'); Bah, Ginger beat me to it As a note though, you can easily tell when you run into this when you use a syntax highlighter. Link to comment https://forums.phpfreaks.com/topic/215807-variable-inside-header-question/#findComment-1121894 Share on other sites More sharing options...
will35010 Posted October 13, 2010 Author Share Posted October 13, 2010 The problem is that you've opened your string with single quotes and closed it with doubles. Try: header('Location: ../application/'.$org.'/display/trackingboard.php'); Thanks! That was it. It's always the little things that get you...lol. Link to comment https://forums.phpfreaks.com/topic/215807-variable-inside-header-question/#findComment-1121896 Share on other sites More sharing options...
will35010 Posted October 13, 2010 Author Share Posted October 13, 2010 header('Location: ../application/".$org."/display/trackingboard.php'); should read: header('Location: ../application/'.$org.'/display/trackingboard.php'); Bah, Ginger beat me to it As a note though, you can easily tell when you run into this when you use a syntax highlighter. Thanks! Link to comment https://forums.phpfreaks.com/topic/215807-variable-inside-header-question/#findComment-1121897 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.