$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 .= "
\n"; $ret .= "You have submitted the following information:
\n"; $ret .= "Name: $User_name
\n"; $ret .= "Email: $User_email
\n"; $ret .= "From: $Place
\n"; $ret .= "Maseches $Maseches $Daf
\n"; $ret .= "Subject: $Subject
\n"; $ret .= "Question:
$Question\n"; $ret .= "
In $Language
\n"; $ret .= "
Answer will be in $Answlang
\n"; $ret .= "
\n"; $ret .= "
Ask another question
\n"; $ret .= "
Return to D.A.F. homepage
(www.dafyomi.co.il)
\n"; $ret .= "\n"; $ret .= ""; $message .= "(Please include header and footer when redistributing this material.)\n"; $message .= "_________________________________________________________________\n\n"; $message .= " THE DAFYOMI DISCUSSION LIST\n\n"; $message .= " brought to you by Kollel Iyun Hadaf of Yerushalayim\n"; $message .= " Rosh Kollel: Rabbi Mordecai Kornfeld\n"; $message .= " daf@dafyomi.co.il\n\n"; $message .= " [REPLY TO THIS MESSAGE TO DISCUSS THE DAF WITH THE KOLLEL]\n"; $message .= "________________________________________________________________\n\n"; $message .= "$Maseches $Daf: $Subject\n\n"; $message .= "$User_name <$User_email> asks:".($Language == 'English' ? '' : "(in $Language)")."\n\n"; $message .= "$Question\n\n"; $message .= "$User_name, $Place\n"; $message .= "----------------------------------------------\n"; $message .= "The Kollel replies:\n"; // $headers = "MIME-Version: 1.0" . "\r\n"; // $headers .= "Content-type:text/html;charset=utf-8" . "\r\n"; $headers .= "Content-type:text/plain; charset=windows-1255" . "\r\n"; $headers .= "From: $User_name <$User_email>\r\n"; $message=stripslashes($message); $mailsuccess = mail($admin_mail, "$Maseches $Daf: $Subject", $message, $headers); } } if ($ret) { if ($mailsuccess) echo $ret; else "Mail was not sent due to error."; } else { ?>
Submission form for Dafyomi Questions to D.A.F.
לעברית
The Internet center for the study of Dafyomi
brought to you by
Kollel Iyun Hadaf
Ask your questions to the Kollel
Submitted by
' />
Email address
'>
City, Country
' SIZE=50 NAME="Place">
QUESTION:
Maseches
Choose a Masechta
GENERAL
selected>
Daf
selected>
Language of question
English
Hebrew
Yiddish
French
Spanish
German
Subject
' />
Question
<?=stripslashes($_POST['Question'])?>
Answer my question in
English
Hebrew
added to gives:
D.A.F. HOMEPAGE
Sponsorships & donations
•
Readers' feedback
Mailing lists
•
Archives
•
Ask the Kollel
Dafyomi weblinks
•
Calendar
Hebrew material