savagenoob Posted November 19, 2010 Share Posted November 19, 2010 I run into this every now and again and wonder if someone knows what I could be doing wrong. Using a simple $ClientID = $_GET['ID']; is not working on a certain page, I can see the ID=193 value in the address field but $ClientID remains an empty variable. I even try $_REQUEST instead, still nothing. I'm puzzled. Link to comment https://forums.phpfreaks.com/topic/219143-_get-not-working/ Share on other sites More sharing options...
JasonLewis Posted November 19, 2010 Share Posted November 19, 2010 Have you tried doing print_r($_GET); to see if there is anything in the array? What's different with this page and other pages? Link to comment https://forums.phpfreaks.com/topic/219143-_get-not-working/#findComment-1136416 Share on other sites More sharing options...
PFMaBiSmAd Posted November 19, 2010 Share Posted November 19, 2010 I'm going to guess you either have some url rewriting that does not pass the query string on the end of the url to the rewritten url or you have some code in the file that is clearing the $_GET variables. Link to comment https://forums.phpfreaks.com/topic/219143-_get-not-working/#findComment-1136419 Share on other sites More sharing options...
savagenoob Posted November 19, 2010 Author Share Posted November 19, 2010 Have you tried doing print_r($_GET); to see if there is anything in the array? What's different with this page and other pages? It displays Array ( [iD] => 193 ) So its in there? Im still puzzled. It wont pass into a variable using $ClientID = $_GET['ID']; When I echo $ClientID it is empty. Link to comment https://forums.phpfreaks.com/topic/219143-_get-not-working/#findComment-1136425 Share on other sites More sharing options...
JasonLewis Posted November 19, 2010 Share Posted November 19, 2010 Show some code. Are you echo'ing the variable, or using die. Because it won't show if you use die, you have to do something like: die("ID: " . $ClientID); Link to comment https://forums.phpfreaks.com/topic/219143-_get-not-working/#findComment-1136427 Share on other sites More sharing options...
savagenoob Posted November 19, 2010 Author Share Posted November 19, 2010 Show some code. Are you echo'ing the variable, or using die. Because it won't show if you use die, you have to do something like: die("ID: " . $ClientID); Ehhhh.... I was putting the PHP code in a file called client.php and including it using require_once('includes/client.php');, when I just transferred all the code to the originating page it works. Blah. Dont know why, but whatever. Thanks guys. Link to comment https://forums.phpfreaks.com/topic/219143-_get-not-working/#findComment-1136428 Share on other sites More sharing options...
savagenoob Posted November 19, 2010 Author Share Posted November 19, 2010 OK, I'm officially ratarded.... I was working on a local copy of client.php in phpdesigner, I had 2 tabs with the same name. Jesus. I seriously wasted like an hour of my life because of this. Link to comment https://forums.phpfreaks.com/topic/219143-_get-not-working/#findComment-1136430 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.