-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajout.php
61 lines (38 loc) · 1010 Bytes
/
ajout.php
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
<?php
$con=mysqli_connect("127.0.0.1","root","root","GUIDE_CONCOURS");
if (!$con)
{
echo ("La connexion a la base de donnee a echouer");
}
$nom=$_POST["nom"];
$prenom=$_POST["prenom"];
$email=$_POST["email"];
$password=$_POST["password"];
$date=$_POST["date"];
$tel=$_POST["tel"];
$check_email= "select * from Users where email='$email'";
$check_tel= "select * from Users where tel='$tel'";
$send_email= mysqli_query($con,$check_email);
$send_tel= mysqli_query($con,$check_tel);
$countEmail= mysqli_num_rows($send_email);
$counttel= mysqli_num_rows($send_tel);
if($countEmail == 1)
{
echo json_encode("Email Existe");
}
else if($counttel == 1)
{
echo json_encode("Tel Existe");
}
else
{
$requete="insert into Users values(null,'$nom','$prenom','$tel','$date','$email','$password')";
$results= mysqli_query($con,$requete);
if($results>0)
{
echo json_encode("success");
}
else
echo json_encode("echec");
}
?>