-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate.php
88 lines (83 loc) · 2.62 KB
/
validate.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
include 'contenu/param.php';
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="description" content="Club de Foot des Taoupats de Daux"/>
<meta name="keywords"
content="taoupats, Taoupats, daux, Daux, foot, Foot, Club, club"/>
<title>Taoupats de Daux</title>
<!-- Styles
+++++++++++++ -->
<link rel="stylesheet" type="text/css"
href="/css/bootstrap.css">
<link rel="stylesheet" type="text/css"
href="/css/bootstrap-responsive.css">
<link rel="stylesheet" type="text/css"
href="/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css"
href="/css/style.css">
<!-- Scripts
+++++++++++++ -->
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/bootstrap.js"></script>
<style>
#stylee {
color: red;
font-weight: bold;
text-transform: uppercase;
font-size: 120%;
}
</style>
</head>
<body>
<?php
$mysqli = new mysqli($serv, $login, $pwd, $data);
if ($mysqli->connect_errno) {
echo "Echec lors de la connexion � MySQL : (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
if (isset($_GET['login'])) {
$login_user = $_GET['login'];
} else {
$login_user = '';
}
// on cr�e la requ�te SQL
$sql = "update user set auto='O' where login = '$login_user';";
$sql2 = "select password, email from user where login = '$login_user';";
// on envoie la requête
$result = $mysqli->query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());
$requete = $mysqli->query($sql2) or die('Erreur SQL !<br>' . $sql2 . '<br>' . mysql_error());
$row = $requete->fetch_assoc();
if ($login == 'root') {
} else {
$sujet = 'Autorisation taoupatsdedaux.fr';
$message = 'Vous pouvez acceder aux sondages sur le site en vous connectant grace a votre login(';
$message .= $login_user;
$message .= ') et mot de passe(';
$message .= $row['password'];
$message .= ') : www.taoupatsdedaux.fr/sondage-mobile.php';
$destinataire = $row['email'];
$headers = "Content-Type: text/html; charset=\"iso-8859-1\"";
if (mail($destinataire, $sujet, $message, $headers)) {
} else {
echo "Une erreur c'est produite lors de l'envois de l'email.";
}
}
?>
<br>
<br>
<br>
<br>
<div class="row-fluid">
<center>
<div class="text-success">
<h4>
<strong>Autorisation effectuée pour <?php echo $login_user; ?></strong>
</h4>
</div>
</center>
</div>
<br> <br>
</body>
</html>