Apan Madhesh
Apan Madhesh

Reputation: 85

$_GET not working in my website

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.

Upvotes: 2

Views: 855

Answers (2)

Bonatti
Bonatti

Reputation: 2781

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

Upvotes: 0

Suresh KUMAR Mukhiya
Suresh KUMAR Mukhiya

Reputation: 616

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()

Upvotes: 1

Related Questions