Jump to content

HELP with PHP $GET


petenetman

Recommended Posts

:-[ It's been driving me mad. For some reason I cannot get the $GET to work.

 

What I have is

 

http://localhost/working/JobData2.php?16

 

I want to pass the valve 16 to a job number i.e $Jobno = $_GET['Jobno'];

 

If I use

 

print_r($_Get);

if($_GET["a"] === "") echo "a is an empty string\n";

if($_GET["a"] === false) echo "a is false\n";

if($_GET["n"] === null) echo "a is null\n";

if(isset($_GET["a"])) echo "a is set\n";

 

 

I get a null value returned.

 

Can some help please?

Link to comment
https://forums.phpfreaks.com/topic/207421-help-with-php-get/
Share on other sites

Your url is incorrect. The format is filenamep.php?variable_name_here=some_value_here. You then use $_GET['variable_name_here'] to get the value from the url.

 

So if your url is http://localhost/working/JobData2.php?a=16 Then you'll use $_GET['a'] to get the value of 16 from the url.

Link to comment
https://forums.phpfreaks.com/topic/207421-help-with-php-get/#findComment-1084415
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.