The Way to Programming
The Way to Programming
Ok everyone I made two different pages
index.php
test.php
Index.php
and test.php
You are protected from players with lower than pop. You are protected from players with bigger than pop.
The problem I’m having at the moment is when I type in for example 100 into the form (index.php) the result doesn’t seem to show correctly in test.php. Seems like my GET and POST or echo’s are wrong somehow…
cobusbo is offline View user’s profile Send private message
It seems you have mixed the $_POST and the echos a little.
We use $_GET at the receiver page to acquire the value we sent with the form. The form sends the “pop” value.
You can access it at test.php with $_POST[“pop”] or $_GET[“pop”] if the form’s action is GET instead of POST.
So:
At index.php you do not need to echo the $pop variable. Just use: value=””
At test.php replace:
$min = ($pop * 20 / 100); $max = ($pop * 100 / 20);
with:
$min = ($_GET["pop"] * 20 / 100); $max = ($_GET["pop"] * 100 / 20);
and:
You are protected from players with lower than pop. You are protected from players with bigger than pop.
with:
You are protected from players with lower than pop. You are protected from players with bigger than pop.
Sign in to your account