1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| case 'envoi' :
// Recieve Variables From Flash
$email = ereg_replace("&", "%26", $_POST['youremail']);
$surname = ereg_replace("&", "%26", $_POST['yoursurname']);
$score = ereg_replace("&", "%26", $_POST['yourscore']);
$email1 = ereg_replace("&", "%26", $_POST['youremail1']);
$email2 = ereg_replace("&", "%26", $_POST['youremail2']);
$email3 = ereg_replace("&", "%26", $_POST['youremail3']);
$email4 = ereg_replace("&", "%26", $_POST['youremail4']);
$ami1 = ereg_replace("&", "%26", $_POST['yourami1']);
$ami2 = ereg_replace("&", "%26", $_POST['yourami2']);
$ami3 = ereg_replace("&", "%26", $_POST['yourami3']);
$ami4 = ereg_replace("&", "%26", $_POST['yourami4']);
$submit = $_POST['submit'];
// Check if its submitted from Flash
if($submit == 'Yes')
{
// Insert the data into the mysql table
$sql2 = "INSERT INTO ".$table;
$sql2 .= " (`ami1`,`ami2`,`ami3`,`ami4`,`email1`,`email2`,`email3`,`email4`) ";
$sql2 .= " VALUES ";
$sql2 .= " ('','$ami1','$ami2','$ami3','$ami4','$email1','$email2','$email3','$email4') ";
$sql2 .= " WHERE email='$email' ";
$insert = mysql_query($sql2, $DBConn) or die("Error in Application: ".mysql_error());
$insert = mysql_query($sql2, $DBConn) or die("Error in Application: " . mysql_error());
$NomExp=$surname;
$NomExp= utf8_decode($NomExp);
$Subject = "$NomExp t'invite à jouer";
$Message = "Bonjour,\n$NomExp t'invite à participer au jeu. Son score est de $score, essaye de faire mieux!";
if($email1){
mail($email1, $Subject, $Message, "From: ". $NomExp." <".$email.">");
}
if($email2){
mail($email2, $Subject, $Message, "From: ". $NomExp." <".$email.">");
}
if($email3){
mail($email3, $Subject, $Message, "From: ". $NomExp." <".$email.">");
}
if($email4){
mail($email4, $Subject, $Message, "From: ". $NomExp." <".$email.">");
}
echo 'gb_status=1';
return;
}
echo 'gb_status=Erreur';
break; |