$_GET return nothing

✔ Recommended Answer

Solved ....The problem was due of a 301 redirect make by a stupid ....

When i try the same thing on this adress it work fine

Thank to all -)

Source: stackoverflow.com

Answered By: Awea

Method #2

The $_GET variable is a superglobal variable in PHP that contains an array of all the HTTP GET parameters passed to the current script via the URL. If $_GET is not returning anything, it could be due to a few reasons:

  1. No GET parameters were passed in the URL: Make sure you are passing parameters in the URL, for example: http://example.com/index.php?param1=value1&param2=value2. If you are not passing any parameters, $_GET will be an empty array.

  2. The HTTP method used is not GET: $_GET only contains GET parameters. If you are using POST or another HTTP method, use the $_POST or $_REQUEST variable instead.

  3. The server configuration is not set up correctly: If you are running PHP on a server, check if the server is configured to allow the use of superglobal variables. If not, you may need to modify the server's settings or use an alternative method to retrieve the GET parameters.

  4. There is a typo in the variable name: Make sure that the variable name you are trying to access is spelled correctly in the URL and in your code.

To help debug, you can try using the var_dump($_GET) function to print the contents of the $_GET variable and see if it contains any values.


Most Popular

Remove Unicode Zero Width Space PHP

PhpStorm, return value is expected to be 'A', 'object' returned

Laravel file upload returns forbidden 403, file permission is 700 not 755