-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraitement.php
executable file
·69 lines (60 loc) · 2.44 KB
/
traitement.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
<?php
// Get the data from the form
$ecole = nl2br(htmlspecialchars($_POST['ecole']));
$annee_candidature = nl2br(htmlspecialchars($_POST['annee_candidature']));
$specialite = nl2br(htmlspecialchars($_POST['specialite']));
$civilite = nl2br(htmlspecialchars($_POST['civilite']));
$date_naissance = nl2br(htmlspecialchars($_POST['date_naissance']));
$nom = nl2br(htmlspecialchars($_POST['nom']));
$prenom = nl2br(htmlspecialchars($_POST['prenom']));
$adresse = nl2br(htmlspecialchars($_POST['adresse']));
$code_postal = nl2br(htmlspecialchars($_POST['code_postal']));
$ville = nl2br(htmlspecialchars($_POST['ville']));
$email = nl2br(htmlspecialchars($_POST['email']));
$telephone = nl2br(htmlspecialchars($_POST['telephone']));
$niv_etude_actuel = nl2br(htmlspecialchars($_POST['niv_etude_actuel']));
$etab_actuel = nl2br(htmlspecialchars($_POST['etab_actuel']));
$projet_pro = nl2br(htmlspecialchars($_POST['projet_pro']));
$concours = nl2br(htmlspecialchars($_POST['concours']));
// Connexion bdd
require_once('admin/hestia.php');
//bcrypt // sel
try
{
$bdd = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8", $username, $password);
} catch (PDOException $e)
{
print "Erreur :" . $e->getMessage() . "<br/>";
die;
}
// Insert into database
$req = $bdd->prepare('INSERT INTO eductive(ecole, annee_candidature, specialite, civilite, date_naissance, nom, prenom, adresse, code_postal, ville, email, telephone, niv_etude_actuel, etab_actuel, projet_pro, concours) VALUES(:ecole, :annee_candidature, :specialite, :civilite, :date_naissance, :nom, :prenom, :adresse, :code_postal, :ville, :email, :telephone, :niv_etude_actuel, :etab_actuel, :projet_pro, :concours)');
$req->execute(array(
'ecole' => $ecole,
'annee_candidature' => $annee_candidature,
'specialite' => $specialite,
'civilite' => $civilite,
'date_naissance' => $date_naissance,
'nom' => $nom,
'prenom' => $prenom,
'adresse' => $adresse,
'code_postal' => $code_postal,
'ville' => $ville,
'email' => $email,
'telephone' => $telephone,
'niv_etude_actuel' => $niv_etude_actuel,
'etab_actuel' => $etab_actuel,
'projet_pro' => $projet_pro,
'concours' => $concours
));
// mis en commentaire ça, et ça marche 9/10/23
//if (!$req->execute(array(
// 'ecole' => $ecole,
// 'specialite' => $specialite,
// 'projet_pro' => $projet_pro,
//))) {
// print_r($req->errorInfo());
//}
// Redirect to the done page
header('Location: done.html');
?>