-1

I am building a contact form using this generator... http://www.webformgenerator.eu/webformgenerator.php

My simple question is how would I add a password in the php script that would deny or allow the form to go through? I am quite new with php.

jfarr
  • 41
  • 4
  • 11

1 Answers1

0
$some_token = "whatever_password";

if( isset($_POST['passwordfield']) AND $_POST['passwordfield'] == $some_token)
{
    $form = new ProcessForm();
    $form->field_rules = array(
        'field1'=>'required',
        'field2'=>'required',
        'field3'=>'required',
        'field4'=>''
    );
    $form->validate();
}
else
{
   echo "Invalid token!";
}
AmazingDreams
  • 3,136
  • 2
  • 22
  • 32