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
| <?php
include("connection.php");
//ini_set('sendmail_from', 'tonmail');
//mail("khniki@NDS.com","eee","aa");
$mail=$_POST['mail'];
$name=addslashes($_POST['name']);
$location=addslashes($_POST['location']);
$telephone=addslashes($_POST['telephone']);
$mobile=addslashes($_POST['mobile']);
$departement=$_POST['departement'];
$main_project=$_POST['main_project'];
$manager=$_POST['manager'];
$login=$_POST['login_user'];
$pass=$_POST['pass_user'];
$valider=$_POST['valider'];
$atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';
$domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // caractères autorisés après l'arobase (nom de domaine)
$regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
if( $_POST['mail']=='' or $_POST['login_user']=='' or $_POST['pass_user']=='' or $_POST['name']=='' ){?> <script language="javascript">
alert("Vous devez remplir les champs obligatoire");
</script>
<?php include("inscription.php");exit; ?>
<?php }
else if ((!preg_match($regex, $mail)) ){ ?>
<script language="javascript">
alert("Vérifiez votre email"); </script>
<?php include("inscription.php");exit;
}
//ini_set('sendmail_from', 'tonmail');
$emailsend="aa@aa.com";
$message="Nouveau user \n". "* Name : ".$name."\n". "* Telephone : ".$telephone."\n". "* Location : ".$location."\n"."* departement :".$departement."\n". "* Main Project :".$main_project."\n"
."* manager :".$manager."\n"."* login : ".$login."\n"."* Password :".$pass."\n"."* Email :".$mail ;
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: $mail \r\nReply-to : <$emailsend>\nX-Mailer:PHP";
$sujet="Demande d'inscription";
$message1="Merci pour votre message ";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: $emailsend \r\nReply-to :<$mail>\nX-Mailer:PHP";
//mail($mail, $emailsend);
ini_set('SMTP','smtp.FR.aaa.com');
if ((mail($emailsend,$sujet,$message,$headers))){
$s=mysql_query("insert into authentification values('','$location','$name','$telephone','$mobile','$departement','$main_project','$manager','$mail','$login','$pass','$valider')");
?>
<script language="javascript">
alert("Votre mail a été envoyé"); </script> <?php include("inscription.php");exit;
} else {
echo ' Une erreur s est produite</font >'; ?>
<script language="javascript">
alert("Une erreur s'est produite"); </script> <?php include("inscription.php");exit;
}
?> |
Partager