Password protected form with HTML and PHP -
i'm making html form , need people validate are. how i'm planning on doing password field. password sent them email. 1 password eneugh, no need dozens of different passwords.
the html
<form action="contact.php" method="post"> <!--entire form here--> <input type="password" name="pwd" placeholder="password" required /> <input type="submit" value="submit" id="button"/> </form>
so question is:
- how select password (i think in contact.php, not sure)
- how process password in contact.php
thanks in advance!
your form sends data page contact.php
here's write in contact.php
you'll value input:
<?php if (isset($_post['pwd'])) { //comparing user input password if ($_post['pwd'] == 'the_good_password_goes_here') { echo 'password good'; } else { echo 'wrong password'; } } ?>
replace the_good_password_goes_here password.
also, please consider reading this
Comments
Post a Comment