eadc Posted May 4, 2007 Share Posted May 4, 2007 Ok, I've been using this script for a long time now and it always worked. Now we have changed hosting company and when I upload the pages again....you guessed it...it does not work. Here is the script of the index.php page: --------------------------------------- //Insert page into structure if (!isset($pg)) {$pg = "home";} if (!include "$pg.php") { trigger_error("Error", ERROR); } ----------------------------------------- Now any link that I click brings me back to "Home" which is not the idea. It seems like $pg is not change when I click on a text with the following link for example: index.php?pg=services. I can' figure it out. Please help. Link to comment https://forums.phpfreaks.com/topic/49924-new-hosting-now-php-does-not-work/ Share on other sites More sharing options...
veridicus Posted May 4, 2007 Share Posted May 4, 2007 You want to use $_GET['pg'] instead of $pg. Your old server automatically converted GET parameters into variables. But the "right" way these days is to use the $_GET array. Link to comment https://forums.phpfreaks.com/topic/49924-new-hosting-now-php-does-not-work/#findComment-245013 Share on other sites More sharing options...
john010117 Posted May 4, 2007 Share Posted May 4, 2007 //Insert page into structure if (!isset($_GET['pg'])) { $pg = "home"; } if (!include "$pg.php") { trigger_error("Error", ERROR); } Link to comment https://forums.phpfreaks.com/topic/49924-new-hosting-now-php-does-not-work/#findComment-245050 Share on other sites More sharing options...
eadc Posted May 4, 2007 Author Share Posted May 4, 2007 Thanks a lot to both of you. It seems I got stuck to "Yesterdays" PHP coding. Link to comment https://forums.phpfreaks.com/topic/49924-new-hosting-now-php-does-not-work/#findComment-245069 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.