"._SENDAJOKE."

" ."" ."" ."
"._SENDERNAME."
"._SENDEREMAIL."
"._SENDTO."
"._SENDTOEMAIL."
"; CloseTable(); include("footer.php"); } function checkemail($toemail) { global $stop; if ((strlen($toemail) >= 4) && (substr($toemail, 0, 4) == 'www.')) $stop = "
Email address invalid: Please remove the beginning WWW.

"; if ((!$toemail) || ($toemail=="") || (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$",$toemail))) $stop = "
Email address invalid: Please use the standard format (email@domain.com)

"; if (strrpos($toemail,' ') > 0) $stop = "
Email address invalid: Please do not use spaces.
"; return($stop); } function send($jokeid, $sendername, $senderemail, $toname, $toemail){ global $sitename, $nukeurl, $prefix, $db, $module_name, $stop; include("header.php"); include("config.php"); checkemail($toemail); if (!$stop) { $result = sql_query("SELECT name from ".$prefix."_jokes where jokeid='$jokeid'", $db); list($name) = $db->sql_fetchrow($result, $db); $subject = ""._SUBJECT." $sitename"; $message = ""._HELLO." $toname:\n\n"._YOURFRIEND." $sendername "._CONSIDERED."\n\n\n$name\n\n"._URL.": $nukeurl/modules.php?name=$module_name&func=JokeView&jokeid=$jokeid\n\n"._YOUCANREAD." $sitename\n$nukeurl"; $toemail = str_replace(" ","",$toemail); mail($toemail, $subject, $message, "From: \"$sendername\" <$senderemail>\nX-Mailer: PHP/" . phpversion()); Header("location: modules.php?name=$module_name&file=send&func=thankyou&jokeid=$jokeid"); } else { OpenTable(); echo "
"._JOKES."
"._JOKEHOME." | "._ADDJOKE." | "._NEWJOKES." | "._POPULAR." | "._BESTRANKED."
"; CloseTable(); echo "
"; OpenTable(); echo "
" ."
"._SEARCHLABEL."
"; CloseTable(); echo "
"; OpenTable(); echo "
"._ERROR."

\n"; echo "$stop
"._GOBACK."


"; CloseTable(); } include("footer.php"); } function thankyou($jokeid){ global $prefix, $db, $bgcolor1, $module_name, $bgcolor2, $site_logo, $sitename, $nukeurl; include("header.php"); OpenTable(); echo "
"._JOKES."
"._JOKEHOME." | "._ADDJOKE." | "._NEWJOKES." | "._POPULAR." | "._BESTRANKED."
"; CloseTable(); echo "
"; OpenTable(); echo "
" ."
"._SEARCHLABEL."
"; CloseTable(); echo "
"; OpenTable(); echo "
"._SENDTHANKYOU."
"._SENDBACK.""; CloseTable(); include("footer.php"); } switch($func) { default: main($jokeid); break; case"send": send($jokeid, $sendername, $senderemail, $toname, $toemail); break; case"thankyou": thankyou($jokeid); break; } ?>