2

I am new to PHP and started learning using w3cschools. I made simple GET query to get query string from URL.

<?php 
$string = $_GET['q'];

var_dump($string);

?>

I saw this post. But it did not help me wither. Any suggestion and guidelines would be helpful.

Community
  • 1
  • 1
Apan Madhesh
  • 85
  • 1
  • 5

2 Answers2

1

If $_GET is not working I suggest you check request order status in php.ini file.

simply call function phpinfo() and search for "request_order" it should be set to GP. I had same issue and this solved my problem. Check the screenshot. output from phpinfo()

1

Suppose the following:

mypage.php:

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

For this to work, you would need to reach the server:

"http://" + Your Server Address + "/" + The Folder + "mypage.php" + "?q=" + a value.

Then, it would output the information; Example:

http://localhost/mypage.php?q=something

Bonatti
  • 2,778
  • 5
  • 23
  • 42