I am having problems creating a simple PHP script. The $_GET["give"]
variable is always 0 in PHP, but I did define it in the URL. If it's not defined, my script redirects.
if (isset($_GET["give"])&&$_GET["give"]!="") {
echo "give GET detected<br />";
$user = $_GET["give"];
echo $_GET["give"]+$user+"<br />";
}
header("Location: /diamonds/"); //this document, but removing arguments.
The URL is fine, /?give=kroltan
, it should echo kroltan. But instead, I get this in the browser:
give GET detected <br>
0
It doesn't even echo the $user
variable, although it's the same value as $_GET["give"]
. And no <br>
after that too