Jump to content

$_GET Not Working


savagenoob

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.