-
Notifications
You must be signed in to change notification settings - Fork 0
/
t.php
40 lines (34 loc) · 915 Bytes
/
t.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
<?php
header("Content-Type: text/plain");
try
{
$bdd = new PDO('mysql:host=localhost;dbname=qyizbowl;charset=utf8', 'root', '0000');
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
if( isset($_POST['pseu'])){
$pseu = htmlspecialchars($_POST['pseu']);
$req = $bdd->query('SELECT pseudo FROM members');
$i = 0;
while ($resultat = $req->fetch()) {
if (strcmp($resultat['pseudo'], $pseu) == 0) {
$i = $i + 1;
}
}
$req = $bdd->query('SELECT pseudo FROM verifcation');
while ($resultat = $req->fetch()) {
if (strcmp($resultat['pseudo'], $pseu) == 0) {
$i = $i + 1;
}
}
if ($i == 1) {
echo "$i";
}
else {
echo "$i";
}
}
?>