html - PHP script failing at submit: The Spam test doesn't work -


in jsfiddle: http://jsfiddle.net/2burl/1/ code php form.

code working spam variables:

$human1 = mt_rand(0, 50); // random number written var $human2 = mt_rand(0, 49); // same $human1 $human_test = 0;  //declaration on variable posted form $spam_test = $human1 + $human2; // sum vars 

code testing:

$human_test = $_post["human_test"];      if (empty($_post["human_test"]))     {         $humanerr = "this field required.";     }     else if ($_post["human_test"] != $spam_test)     {         $humanerr = "wrong answer, try again.";     }     else     {     if ($_post['submit'] && $test_error == 0 && $human_test == $spam_test)     { 

the problem when required fields set , posted @ submit "spam test" fails everytime no matter if answer right or wrong.

syntax errors not present. i've tested value of $spam_test , sumed togehter, $_post $human_test doesn't work somehow.

i if error inputed value incorrect.

does see error in code? or have way test error lies?

thanks helping.

although seems there don't understand, can use css rule margin: 0px auto; div want centered... check out fiddle: http://jsfiddle.net/ln5zs/

<div style="height:150px; width:150px; background:red; margin:0px auto;"> <div style="height:150px; width:100px; background:yellow; margin:0px auto;">     <div style="height:150px; width:80px; background:blue; margin:0px auto;">centered div</div> </div> 


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -