New to PHP, keep that in mind.
My question:
I have a checkbox setup, however when someone clicks a checkbox it returns a '1' instead of the value. How do I fix this?
<td valign="top">Kies minimaal 1 tijdschrift:</td>
<td><input type="checkbox" name="gamez" value="gamez" />Stuur mij informatie over het tijdschrijft GAMEZ<br />
$gamez = (isset($_POST["gamez"]) ?
true : false);
echo("<tr><td>Tijdschriften:</td><td>$gamez $girls $uitgaan $mode</td></tr></table>");
When I check gamez for instance, it shows: Tijdschriften: 1
Of course. You are writing true into it, which is cast to string "1" when you echo it. Write the value in it:
$option1 = (isset($_POST["option1"]) ? $_POST["option1"] : false);
echo("<tr><td>Options:</td><td>$option1</td></tr></table>");
Note that when $_POST["option1"] is not set, $option1 is false, which when echo'd is cast to an empty string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With