$renum=$_GET['link'];
if (isset($_POST['li'])) $renum=$_POST['li'];
//echo $renum;
include_once("iuaconfig.php");
include_once("iuafuns.php");
global $noreply_email, $link, $msgtxt, $sitename;
$link = dbconnect();
$cbcode=rand(0,9);
$cbcode.=rand(0,9);
$cbcode.=rand(0,9);
$cbcode.=rand(0,9);
$cbcode.=rand(0,9);
$cbcode.=rand(0,9);
$cbcode.=rand(0,9);
$cbcode.=rand(0,9);
$cbcode.=rand(0,9);
$cbcode.=rand(0,9);
$pageErrorMsg = "";
$pageSuccessMsg = "";
session_start();
//Replace the code
$msgtxt = str_replace("[CBCODE]", $cbcode, $msgtxt);
//Name of the sender
$una = $_POST['un'];
if(isset($una))
{
$msgtxt = str_replace("[NOMBRE_USUARIO]", $una, $msgtxt);
}
//echo 'una '.$una;
//echo '
'.$msgtxt;
//exit;
//Email of the sender
$uem = $_POST['ue'];
if(isset($uem))
{
$msgtxt = str_replace("[EMAIL_USUARIO]", $uem, $msgtxt);
}
//Name of the sender
$fna = $_POST['fn'];
if(isset($fna))
{
$msgtxt = str_replace("[NOMBRE_AMIGO]", $fna, $msgtxt);
}
//Email of the friend
$fem = $_POST['fe'];
//echo count($HTTP_POST_VARS);
if(count($_POST))
{
$pageErrorMsg.=validate_post();
//echo $pageErrorMsg;
if($pageErrorMsg=="")
{
//Insert into the invitations table
$seml = $_POST['ue'];
$feml = $_POST['fe'];
$snam = $_POST['un'];
$fnam = $_POST['fn'];
$q="INSERT INTO x_invitations SET seml = '$seml', feml = '$feml', snam = '$snam', fnam = '$fnam', cbcode = '$cbcode' ON DUPLICATE KEY UPDATE snam = '$snam', fnam = '$fnam', cbcode = '$cbcode'";
mysql_query($q);
$emailstosend = $_POST['fe'];
//If admin wants a copy of the mail, add admin email to the recepients
if($copytoadmin == 1)
{
$emailstosend = $emailstosend . "," . $admin_email;
}
if(send_mail_plain_new($emailstosend,$noreply_email,$_POST['ue'],$sitename . " invitation from " . $_POST['un'],$msgtxt))
{
$pageSuccessMsg = "ÉXITO! Correo enviado con éxito! Utilice el siguiente formulario para invitar a más amigos y familiares";
//See if total of minimum required invites are sent successfully to give access to the book
$q1="SELECT COUNT( * ) FROM x_invitations WHERE seml = '$seml'";
if($r1=mysql_query($q1))
{
$sdata=mysql_fetch_array($r1);
// $pageSuccessMsg .= "
Has enviado en total $sdata[0] invitaciones hasta ahora.";
}
}
}
}
?>
include("iuaheader.php"); ?> | ||
echo $pageErrorMsg; ?>
echo $pageSuccessMsg; ?>
Invita a tus amigos y familiares Introduzca los datos en el siguiente formulario: |
||
include("iuafooter.php"); ?> |