Created
August 31, 2017 02:29
-
-
Save thgiang/a506009385c5164d77e3ace99b21f115 to your computer and use it in GitHub Desktop.
A field to input password and validate it before submit the contact form.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Please see my video: https://drive.google.com/file/d/0B0q3Kha3KEfUZFhsdFA2MlpuU2s/view?usp=sharing | |
//Code: | |
//ID of password field | |
$field_id = 28; | |
//List of password | |
$accepted = array('bravebits','joomlashine','woorocket','sellersmith','golden','river'); | |
if (!in_array($post['password'][$field_id][0], $accepted)) | |
{ | |
// Wrong password | |
echo '<input type="hidden" name="error" value=\'{"'.$field_id.'":"Wrong password"}\'/>'; | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment