ok,
I have a checkbox (that asks if you want to add a password) and then a textbox (that allows the user to enter a password if the checkbox is checked)
I would like the php script (say for example x.php) to run said script ONLY IF the checkbox is checked
as in, the PHP script will include the password (of the text of the textbox) as a variable that I can assign to whatever I am doing
Please help, for google has failed me yet again
Regards.
PHP - How do I include a checkbox???
Moderator: General Moderators
Re: PHP - How do I include a checkbox???
That's not how it works. You get the password box (empty or not) regardless - you decide whether you want to use it.xtk wrote:as in, the PHP script will include the password (of the text of the textbox) as a variable that I can assign to whatever I am doing
Code: Select all
if (isset($_POST["checkbox"])) {
// checkbox was checked
} else {
// checkbox was not checked
}