JavaScript and PHP - A little confused on how to work them together.

Posted by Doug on Stack Overflow See other posts from Stack Overflow or by Doug
Published on 2010-05-09T05:43:30Z Indexed on 2010/05/09 5:48 UTC
Read the original article Hit count: 213

Filed under:
|

So right now, I'm just using a basic form to check a password. I want it to check the password and basically remain on page.html so I can use JavaScript to alert incorrect password or something. I'm not really sure how to do that. It seems it would bring me to check.php. I'm not too sure on the whole process, any help appreciated! Thanks!

Page.html

<form action="check.php" method="post">
    <input type="password" name="password" />
    <input type="submit" value="Submit" />

</form>

check.php

   <?php
    $password = $_POST['password'];
    if ( $password != "testing" ) {
        die();
    }
?>

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript