kiowa_jackson Posted December 4, 2007 Share Posted December 4, 2007 I have made two pages with <?php echo $tid; ?> on them, and uploaded them. One is at the top level and works, the other is in a folder and does not work. http://www.believeandmanifest.com/echo.php?tid=works http://www.believeandmanifest.com/1/echo.php?tid=doesnotwork Can someone tell me why this is? THanks Link to comment https://forums.phpfreaks.com/topic/80047-solved-how-to-echo-variable-on-urls-that-are-not-top-level/ Share on other sites More sharing options...
teng84 Posted December 4, 2007 Share Posted December 4, 2007 big WHAT? Link to comment https://forums.phpfreaks.com/topic/80047-solved-how-to-echo-variable-on-urls-that-are-not-top-level/#findComment-405601 Share on other sites More sharing options...
trq Posted December 4, 2007 Share Posted December 4, 2007 Neither should work, but it has nothing to do with what directory your files are in. <?php echo $_GET['tid']; ?> Link to comment https://forums.phpfreaks.com/topic/80047-solved-how-to-echo-variable-on-urls-that-are-not-top-level/#findComment-405603 Share on other sites More sharing options...
kiowa_jackson Posted December 4, 2007 Author Share Posted December 4, 2007 Neither should work, but it has nothing to do with what directory your files are in. that's weird, http://www.believeandmanifest.com/echo.php?tid=works has exactly that line of code of it, and I used that on several other pages and it works...is the page displaying the value on the page in the h1 tag? Thanks for that though, that fixed it. Link to comment https://forums.phpfreaks.com/topic/80047-solved-how-to-echo-variable-on-urls-that-are-not-top-level/#findComment-405619 Share on other sites More sharing options...
btherl Posted December 4, 2007 Share Posted December 4, 2007 It's to do with an option called "register_globals" For whatever reason, register_globals is on in your top directory but off in the other directory. As a result, $tid works in the top one, but the full form $_GET['tid'] must be used in the other one. Link to comment https://forums.phpfreaks.com/topic/80047-solved-how-to-echo-variable-on-urls-that-are-not-top-level/#findComment-405622 Share on other sites More sharing options...
kiowa_jackson Posted December 4, 2007 Author Share Posted December 4, 2007 It's to do with an option called "register_globals" For whatever reason, register_globals is on in your top directory but off in the other directory. As a result, $tid works in the top one, but the full form $_GET['tid'] must be used in the other one. thanks Link to comment https://forums.phpfreaks.com/topic/80047-solved-how-to-echo-variable-on-urls-that-are-not-top-level/#findComment-405642 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.