undefined $_GET index.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there!!

I've written the following code:

<?php
var_dump($_GET['r']);
?>

and save it to a file named: test.php.
Afterwards, I've launch the PHP binary on my Debian Linux machine with the following line:

"php -S 127.0.0.1:8000 test.php"

in order to use the built-in PHP web server.
then, I've fired up my browser and enter the following in the location bar:

"http://127.0.0.1:8000/test.php?r=something";

The PHP built-in web server responded in the terminal as followed:

"[Tue Dec 24 23:56:31 2013] PHP Notice: Undefined index: r in /home/user/Desktop/new_raf_jewl/test.php on line 3"

My question is simply why? what's wrong with my above PHP snippet? and the strange thing here is that the PHP binary replies to the browser with the following:

" string(9) "something" "

so what's going here? is the $_GET['r'] index is defined or not?

NOTE: I'm using the php-cli (Command Line Interface) version of the PHP binary.

Regards,

atar.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux