$v) if(preg_match($reg,$v)) return false; return true; } $num1 = rand (1 , 5); $num2 = rand (1 , 5); setcookie('testquestion',$num1+$num2); $nums = array('','one','two','three','four','five'); if ($_POST['posted']) { if ($_POST['testquestion'] != $_COOKIE['testquestion']) $errors .= 'Please answer the math\nquestion.\n'; if ($_POST['User_email'] != "") { $email = filter_var($_POST['User_email'], FILTER_SANITIZE_EMAIL); if (!filter_var($email, FILTER_VALIDATE_EMAIL) || $email!=$_POST['User_email']) { $errors .= 'The e-mail address '.$_POST['User_email'].'is an invalid address.\n'; } } else { $errors .= 'Please enter your e-mail\naddress.\n'; } if (!$_POST['User_name']) $errors .= 'Please enter your name.\n'; if (!$_POST['Subject']) $errors .= 'Please enter a Subject.\n'; if (!$_POST['Question']) $errors .= 'Please enter a Question.\n'; if (!$errors) { // $context = stream_context_create(array( // 'http' => array( // 'method' => 'POST', // 'header' => "Content-type: application/x-www-form-urlencoded\r\n", // 'content' => http_build_query(array('value' => $value)), // 'timeout' => 90, // ), // )); // $ret = file_get_contents('http://www.dafyomi.co.il/cgi-bin/askollel-secure_oa8sdfuink9iuhj.cgi', false, $context); foreach(array('User_name','User_email','Place','Maseches','Daf','Subject','Language','Question','Answlang') as $key) $$key = strip_tags($_POST[$key]); $Daf = str_pad($Daf, 3, "0", STR_PAD_LEFT); $vulnerables = array($User_name,$User_email); if(!is_secure($vulnerables)) die("Hacker?"); $ret .= "\n"; $ret .= "\n"; $ret .= "
\n"; $ret .= "In $Language
\n"; $ret .= "Answer will be in $Answlang
Sponsorships & donations
• Readers' feedback Mailing lists • Archives • Ask the Kollel Dafyomi weblinks • Calendar Hebrew material |
}?> }?>