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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
| <?php
session_start();
// *******
require '../connexion.php';
// *******
if (isset($_POST['submit'])) {
$InputName = htmlspecialchars($_POST['InputName']);
$InputEmailId = htmlspecialchars($_POST['InputEmailId']);
$ConfirmEmailId = htmlspecialchars($_POST['ConfirmEmailId']);
$InputPassword = md5($_POST['InputPassword']);
$ConfirmPassword = md5($_POST['ConfirmPassword']);
$InputNameLength = strlen($InputName);
// *******
if ($InputNameLength > 5 and $inInputNameLength <= 25) {
if ($InputEmailId == $ConfirmEmailId) {
if (filter_var($InputEmailId, FILTER_VALIDATE_EMAIL)) {
$reqmail = $connexion->prepare("SELECT * FROM compte WHERE InputEmailId = ?");
$reqmail->execute(array($InputEmailId));
$mailexist = $reqmail->rowCount();
if ($mailexist == 0) {
if ($InputPassword == $ConfirmPassword) {
$query = "INSERT INTO compte(InputName, InputEmailId, InputPassworde) VALUE (:InputName, :InputEmailId, :InputPassword)";
$query_run = $connexion->prepare($query);
$table = [
'InputName' => $InputName,
'InputEmailId' => $InputEmailId,
'InputPassword' => $InputPassword,
];
$query_excecute = $query_run->execute($table);
if ($query_excecute) {
?>
<script>
iziToast.success({
id:'success',
title: 'RastaBomboclat',
message: 'Inscription enregistré avec succès!!!',
position: 'topCenter',
});
</script>
<?php
}
else {
?>
<script>
iziToast.error({
id:'error5',
title: 'RastaBomboclat',
message: 'Un problème est survenu...',
position: 'center',
});
</script>
<?php
}
}
else {
?>
<script>
iziToast.error({
id:'error4',
title: 'RastaBomboclat',
message: 'Les deux password doivent être identiques!!!',
position: 'center',
});
</script>
<?php
}
}
else {
?>
<script>
iziToast.error({
id:'error3',
title: 'RastaBomboclat',
message: 'Cet email est déjà utiliser!!!',
position: 'center',
});
</script>
<?php
}
}
else {
// ?>
<script>
iziToast.error({
id:'error2',
title: 'RastaBomboclat',
message: 'Veuillez verifier le format de votre email: monmail@email.com',
position: 'center',
});
</script>
<?php
}
}
else {
// ?>
<script>
iziToast.error({
id:'error3',
title: 'RastaBomboclat',
message: 'Les 2 emails doivent être identiques',
position: 'center',
});
</script>
<?php
}
}
else {
?>
<script>
iziToast.error({
id:'error',
title: 'RastaBomboclat',
message: 'Entre 5 et 25 caractères',
position: 'topCenter',
});
</script>
<?php
}
}
?>
<!DOCTYPE html>
<html lang="en">
<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>RastaBomboclat | Inscription</title>
<link rel="stylesheet" href="plugins/iziToast/dist/css/iziToast.min.css">
</head>
<body>
<!-- le formulaire d'inscription fonctionne a merveille!!! -->
<script src="plugins/iziToast/dist/js/iziToast.min.js"></script>
<script>
$(document).ready(function(){
iziToast.show({
id: 'show',
title: 'RastaBomboclat',
message: 'Show my Toast',
position: 'topCenter',
color:'black',
image: 'rastaman.png',
transitionIn: 'bounceInDown'
});
});
</script>
</body>
</html> |
Partager