2013-08-03 72 views
-1

我建立使用該生成器的接觸形式... http://www.webformgenerator.eu/webformgenerator.php聯繫表格密碼

我簡單的問題是如何將我的PHP腳本,將拒絕或允許的形式去通過添加密碼嗎?我用PHP很新。

+0

'if($ input_password == $ some_token){// Submit} else {echo「Access denied!」; ''? – AmazingDreams

+0

這裏是訪問php的小提琴我生成http://jsfiddle.net/jfarr07/sf2RR/1/ – jfarr

+0

@jfarr這些可以幫助http://forum.codecall.net/topic/58268-form-tokens-with -php/**和** http://stackoverflow.com/a/2034310/1415724 –

回答

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!"; 
}