-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
64 lines (54 loc) · 1.76 KB
/
signup.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
<?php
use classes\DBconnection\DBconnection;
use classes\Subscription\Subscription;
include './classes/DBconnection.php';
include './classes/Subscription.php';
$response;
if (count($_POST) > 0) {
$db = new DBconnection('E5');
$dbConn = $db->connect();
if (gettype($dbConn) !== 'string') {
$subscr = new Subscription($_POST);
if ($subscr->addToDB($dbConn)) {
$head = "Succès";
$response = "Merci, " . $_POST['name'].".Ton compte a été crée !";
} else {
$head = "Erreur DB";
$response = "Un erreur est survenu lors de l'ajout de données à la DB.";
}
} else {
$head = "Erreur Connection DB";
$response = "Un erreur est survenu lors de la connection à la DB.";
}
$dbConn->close();
} else {
$head = "Erreur données";
$response = "Un erreur par rapport aux données du formulaire !";
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Facebook - Connexion ou inscription</title>
<link rel="shortcut icon" href="https://static.xx.fbcdn.net/rsrc.php/yb/r/hLRJ1GG_y0J.ico">
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="overlay"></div>
<form class="fb-response fb-form" action="signup.php" method="POST">
<div>
<h1 class="txt-head"><?= $head ?></h1>
</div>
<div class="hr"></div>
<div class="fl-col">
<p class="txt-response">
<?php echo $response; ?>
</p>
</div>
<a class="btn-return btn-submit" href="./index.php">Retourner</a>
</form>
</body>
</html>