require("inc/apodhead_noad.php");
//=======================================================
if( isset($_POST['tafgo']) )process_taf();
else dp_taf();
require("inc/apodfoot_noad.php");
//=======================================================
function process_taf(){
$fromemail=cleantag($_POST['fromemail']);
$cmt=cleantag($_POST['cmt']);
if($fromemail==""){print("You didn't give a valid From email address.");return;}
if(strpos($fromemail,"@")===false){print("You didn't give a valid From email address.");return;}
if(strpos($fromemail,"DarkSites.com")!==false){print("Sorry, your email address has been blocked.");return;}
if(strpos($fromemail,"yandex.com")!==false){print("Sorry, your email address has been blocked.");return;}
if(strpos($fromemail,"cepk.info")!==false){print("Sorry, your email address has been blocked.");return;}
if(strpos($fromemail,"ceprk.info")!==false){print("Sorry, your email address has been blocked.");return;}
if(isSpam($cmt,$_POST['page'])!=""){print('Error sending this mail.
');return;}
$subject="ArcadePod.Com Invitation by ".cleantag($_POST['fromname']);
$mailhead="from: ".$fromemail."\n";
$mBody="From ".$_POST['fromname']."\n\n";
if( $_POST['cmt'] !="" )$mBody="From ".cleantag($_POST['fromname'])."\n\n".$cmt."\n\n";
$mBody.="at ".$_POST['page'].
"\n\n----------------------------------------\n\n".
"Your friend ".$_POST['fromname']." has invited you to come visit ArcadePod.Com.\n".
"\n".
"We are the Ultimate Free Online Gaming Resource available on the web.\n".
"Find all your online gaming need right here.\n".
"\n".
"Search our giant directory of free online games.\n".
"We have over 1000+ listings of games created in Java, Flash and Shockwave so you will never run out of games to play.\n".
"If you are looking for action, adventure, puzzle, sports, or racing games, we have them all sorted by easy to find categories.\n".
"We also have a giant listing of online 3D games and multiplayer games. So check it out.\n".
"\n".
"Sincerely,\n".
"ArcadePod.Com\n".
"\n".
"Online Games: http://www.ArcadePod.Com/games/\n".
"\n\n".
"___________________________________________________\n".
"Play free games on at http://www.ArcadePod.Com";
$vERR="";
$vRESULT="";
$toemail="";
$lastemail="";
$emailsent=0;
for($i=1;$i<=5;$i++){
$email=cleantag($_POST['toemail'.$i]);
if($email!="" && $email!=$lastemail){
if(strpos($email,"@")>1){
$lastemail=$email;
//print("TO: ".$_POST['toemail'.$i]);
if( !mail($email,$subject,$mBody,$mailhead) )
{$vERR .= $email.".
"; }
else {$vRESULT .= $email."
"; }
if($toemail!="")$toemail.=",";
$toemail.=$email;
$emailsent++;
}
}
}
if($vRESULT!=""){ print("
".$vRESULT."
has been notified of our great site.
"); }
if($vERR!=""){ print("There was a problem emailing the following:
".$vERR."
");}
if($_POST['sendself']=="yes"){
if(mail($fromemail,$subject,$mBody,"from: webmaster@arcadepod.com\n"))
print("A copy was sent to ".$fromemail."");
else print("There was a problem sending a copy to ".$fromemail);
$emailsent++;
}
print('
THANK YOU!!
');
if($emailsent>0){
require("inc/db.php");
$db = mysql_connect($dbserver,$dbuser,$dbpw);
mysql_select_db($dbname,$db);
mysql_query("insert into log_taf(fromname,fromemail,toemail,comment,dt,ip,page,ref) values('".cleantagSQL($_POST['fromname'])."','".cleantagSQL($_POST['fromemail'])."','".$toemail."','".cleantagSQL($_POST['cmt'])."',now(),'".$_SERVER['REMOTE_ADDR']."','".$_POST['page']."','".$_SERVER['HTTP_USER_AGENT']."')");
mysql_close($db);
}
}
//=======================================================
function dp_taf(){
?>
}
//==============================================================
function isSpam($x,$p){
$ln=strlen($x);
$x=strtolower($x);
if($ln>500) return "Sorry, your message is too long.";
$p=trim(strtolower($p));
if($p!="" && substr($p,0,5)!="http:")return "Spam";
$s="";
for($i=0;$i<$ln;$i++)if(substr($x,$i,1)!=" ")$s.=substr($x,$i,1);
if( strpos($s,"creditcard")!== false) return "Spam";
if( strpos($s,"http://")!== false) return "Spam";
if( strpos($s,"[url=")!== false) return "Spam";
if( strpos($s,"viagra")!== false) return "Spam";
$tstr=explode(" ",$x);
$maxrec=count($tstr);
$c=0;
$w1="x";
$w2="t";
for($i=0;$i<$maxrec;$i++){
if(strlen($tstr[$i])>30) return "Please do not use SUPER LONG words.";
if($w1==$w2 && $w2==$tstr[$i]) return "Please do not REPEAT the same words more the 3 times in a row.
Like the word '".$w2."'";
switch($c){
case 0:$c++; $w1=$tstr[$i]; break;
case 1:$c++; $w2=$w1;$w1=$tstr[$i]; break;
case 2:$w2=$w1;$w1=$tstr[$i]; break;
}
}
return "";
}
//=======================================================
function cleantag($s){return strip_tags(trim($s));}
function cleantagSQL($s){return str_replace("'","'",strip_tags(trim($s)));}
?>