我正在使用此生成器构建联系表单... http://www.webformgenerator.eu/webformgenerator.php
我的简单问题是如何在php脚本中添加一个拒绝或允许表单通过的密码?我对php很新。
答案 0 :(得分: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!";
}