Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.