I have some trouble with running an action when a checkbox is checked or unchecked. (i want to run the action as soon the checkbox is checked)
I tried with an action that makes an if statement run
<input type="hidden" name="Action" value="check">
<input type="checkbox" name="vehicle" value=""> Edited<br>
if (isset($_POST['Action']) && ($_POST['Action'] == 'check')) {
var_dump('random check');
}
I also tried with a href that links it to another page which also didn't work.
<input type="checkbox" name="vehicle" value="" href="ingevoerd.php"> Edited<br>
The goal is to run a prepared statement with an update Mysql query. Like this one
$stmt = $db->prepare('UPDATE personen SET firstname=?, lastname=?, telefoonnummer=? where id = ?');
$stmt->execute(array($firstname,$lastname,$telephonenumber,$user['id']));
I prefer using php over javascript, but i am open for some sugestions