ibanez270dx Posted August 22, 2006 Share Posted August 22, 2006 Hi, I have a portion of code in my PHP program that works on my personal server, but not on the freshly installed server here at work... Originally, my server had PHP version 4.3.11, whereas my new server has PHP 5.1.5. Here is the problem... This snippet of code no longer can pass the variables to the next page:[code=php:0]<a href="export.php?w=1&month=<? echo $today_month; ?>&year=<? echo $today_year; ?>&listorder=<? echo $listorder; ?>&filename=<? echo $thefilename; ?>" name="2excel" class="print" target="_blank"><img src="images/excel.gif" border="0"> <b>Export to Excel</b></a>[/code]However, when I use sessions, it works. I don't know what could be wrong... I'm thinking it has to do with configuration settings somehow, but I don't know what... Thanks, - Jeff Link to comment https://forums.phpfreaks.com/topic/18319-passing-variables-w-php-515/ Share on other sites More sharing options...
Corona4456 Posted August 22, 2006 Share Posted August 22, 2006 It could have to do with register globals. If register globals is off in your config at work but on at your home site then that could be the problem. Link to comment https://forums.phpfreaks.com/topic/18319-passing-variables-w-php-515/#findComment-78689 Share on other sites More sharing options...
ibanez270dx Posted August 22, 2006 Author Share Posted August 22, 2006 It worked! Good call! Thanks! Link to comment https://forums.phpfreaks.com/topic/18319-passing-variables-w-php-515/#findComment-78708 Share on other sites More sharing options...
Corona4456 Posted August 22, 2006 Share Posted August 22, 2006 Sweet! :D Your welcome! Link to comment https://forums.phpfreaks.com/topic/18319-passing-variables-w-php-515/#findComment-78711 Share on other sites More sharing options...
Yesideez Posted August 22, 2006 Share Posted August 22, 2006 I always write my code as if globals are turned on.If I'm needing to carry variables from one script to another then I send them one way or another whether it be via the URL or using forms. Any variables that I'm using fresh I make sure they're clear first or set to what they need to be set to.That way when my code gets moved from server to server like a lot has done in the past I know it stands a much higher chance of working as I want it to.Never presume globals are always on or off. Link to comment https://forums.phpfreaks.com/topic/18319-passing-variables-w-php-515/#findComment-78714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.