Just upgrade php, very simple sample does not work properly
test.php
<?php
echo "$query";
?>
when I call
test.php?query=5
It should display
5
but What I got is nothing display which mean $query is ''
Your comment welcome
Just upgrade php, very simple sample does not work properly
test.php
<?php
echo "$query";
?>
when I call
test.php?query=5
It should display
5
but What I got is nothing display which mean $query is ''
Your comment welcome
Its a new secuirty feature. It used to be called register globals.
http://php.net/manual/en/security.globals.php
Not you have to use the $_GET, $_POST or use $_REQUEST global variables to obtain this information.
for example your code would be
<?php
echo $_GET['query'];
?>
In your previous PHP register_globals directive was on, allowing you to use $REQUEST array's elements as global variables. That's why the code worked. This feature was deprecated in PHP 5.3.0 and removed in PHP 5.4.0: http://www.php.net/manual/en/ini.core.php#ini.register-globals
Don't use it. Apply to $_GET, $_POST and $_REQUEST arrays directly.
Your upgrade turned off the insecure, horrible, and smelly register_globals. You are better off for this, despite the work you must now do.
You will have to change every instance of
$query
to
$_GET['query']
File the time spent under "Security".
You need to use $_GET
An associative array of variables passed to the current script via the URL parameters.
http://www.php.net/manual/en/reserved.variables.get.php
$query = $_GET['query'];