mardi 21 juillet 2020

Multiple If AND conditions with POST in PHP [duplicate]

When submitting the form, I can echo "It works" with the POST update condition on its own or with the two in_array conditions, but not with the three conditions all together, see below. Whats wrong?

<?php
if (    isset($_POST['update']) 
        and (in_array($_GET['edit'], $checkJobId)) 
        and (in_array($_GET['ai'], $checkoutAlertId)))
{
    echo 'It Works';
}
?>      
    <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
        Name: <input type="text" name="name" ><br>
        <input type="submit" name="update" value="update">
    </form>

Aucun commentaire:

Enregistrer un commentaire