Bonjour, Voilà je suis entrain de créer un formulaire "Login" dans lequel l'utilisateur (ici un admin...) saisit son username et son password, il clique ensuite sur le bouton login pour accéder au page d’accueil
Mon problème est lorsque je clique sur bouton "login" il n'affiche rien
voila mon code php :
<?php
$PARAM_hote='localhost';
$PARAM_nom_bd='inscription';
$PARAM_utilisateur='root';
$PARAM_mot_passe='';
$bdd= new PDO('mysql:host='.$PARAM_hote.';dbname='.$PARAM_nom_bd , $PARAM_utilisateur, $PARAM_mot_passe,
array(PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION));
if(isset($_POST['submit'])){
$nom=$_POST['username'];
$password=$_POST['password'];
$sql="select * from auth where nom='".$nom."' AND password='".$password."' limit 1";
$result=mysqli_query($bdd,$sql);
if(!$result || mysqli_num_rows($result)==1){
echo " You Have Successfully Logged in";
exit();
}
else{
echo " You Have Entered Incorrect Password";
exit();
}
}
?>
et voila mon code html :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
body {
background-image: url("http://techdefencelabs.com/public/img/services/network-penetration.jpg");
background-size: cover;
}
#container {
width: 400px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
margin-top: 10%;
}
form {
width: 100%;
padding-top: 30px;
padding-right: 30px;
padding-bottom: 30px;
padding-left: 30px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #f1f1f1;
border-right-color: #f1f1f1;
border-bottom-color: #f1f1f1;
border-left-color: #f1f1f1;
-moz-border-top-colors: none;
border-top-colors: none;
-moz-border-right-colors: none;
border-right-colors: none;
-moz-border-bottom-colors: none;
border-bottom-colors: none;
-moz-border-left-colors: none;
border-left-colors: none;
border-image-source: none;
border-image-slice: 100% 100% 100% 100%;
border-image-width: 1 1 1 1;
border-image-outset: 0 0 0 0;
border-image-repeat: stretch stretch;
background-color: white;
background-image: none;
background-repeat: repeat;
background-attachment: scroll;
background-clip: border-box;
background-origin: padding-box;
background-position-x: 0%;
background-position-y: 0%;
background-size: auto auto;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2), 0px 5px 5px 0px rgba(0, 0, 0, 0.24);
}
#container h1 {
width: 38%;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
padding-bottom: 10px;
}
input[type="text"], input[type="password"] {
width: 100%;
padding-top: 12px;
padding-right: 20px;
padding-bottom: 12px;
padding-left: 20px;
margin-top: 8px;
margin-right: 0px;
margin-bottom: 8px;
margin-left: 0px;
display: inline-block;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #cccccc;
border-right-color: #cccccc;
border-bottom-color: #cccccc;
border-left-color: #cccccc;
-moz-border-top-colors: none;
border-top-colors: none;
-moz-border-right-colors: none;
border-right-colors: none;
-moz-border-bottom-colors: none;
border-bottom-colors: none;
-moz-border-left-colors: none;
border-left-colors: none;
border-image-source: none;
border-image-slice: 100% 100% 100% 100%;
border-image-width: 1 1 1 1;
border-image-outset: 0 0 0 0;
border-image-repeat: stretch stretch;
box-sizing: border-box;
}
input[type="submit"] {
background-color: #53af57;
color: white;
padding-top: 14px;
padding-right: 20px;
padding-bottom: 14px;
padding-left: 20px;
margin-top: 8px;
margin-right: 0px;
margin-bottom: 8px;
margin-left: 0px;
border-top-width: medium;
border-right-width: medium;
border-bottom-width: medium;
border-left-width: medium;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
border-top-color: currentcolor;
border-right-color: currentcolor;
border-bottom-color: currentcolor;
border-left-color: currentcolor;
-moz-border-top-colors: none;
border-top-colors: none;
-moz-border-right-colors: none;
border-right-colors: none;
-moz-border-bottom-colors: none;
border-bottom-colors: none;
-moz-border-left-colors: none;
border-left-colors: none;
border-image-source: none;
border-image-slice: 100% 100% 100% 100%;
border-image-width: 1 1 1 1;
border-image-outset: 0 0 0 0;
border-image-repeat: stretch stretch;
cursor: pointer;
width: 100%;
}
input[type="submit"]:hover {
background-color: white;
color: black ;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #53af57;
border-right-color: #53af57;
border-bottom-color: #53af57;
border-left-color: #53af57;
-moz-border-top-colors: none;
border-top-colors: none;
-moz-border-right-colors: none;
border-right-colors: none;
-moz-border-bottom-colors: none;
border-bottom-colors: none;
-moz-border-left-colors: none;
border-left-colors: none;
border-image-source: none;
border-image-slice: 100% 100% 100% 100%;
border-image-width: 1 1 1 1;
border-image-outset: 0 0 0 0;
border-image-repeat: stretch stretch;
}
#maha {
background-attachment: scroll;
background-repeat: repeat repeat;
background-origin: border-box;
font-size: 100%;
font-weight: bolder;
font-style: normal;
text-align: left;
}
</style>
</head>
<body >
<div id="page" class="site">
<div class="content-wrapper">
<header id="page-header" class="page-header header-06 dark-logo-version">
<div class="page-header-place-holder"></div>
<div id="page-header-inner" class="page-header-inner" data-sticky="1">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="header-wrap">
<div class="branding">
<div class="branding__logo"> <img src="https://www.sotetel.tn/site/wp-content/uploads/2019/04/logo2.png"
alt="Sotetel" class="light-logo" style="width: 324px; height: 119px;">
</div>
</div>
</div>
<div class="container">
<!-- zone de connexion -->
<form method="POST" action="connect.php" >
<h1>Connexion</h1>
<label> <b>Nom d'utilisateur</b></label>
<div class="form-input">
<input placeholder="Entrer le nom d'utilisateur"
name="username" required="" type="text"></div>
<label> <b>Mot
de passe</b></label>
<div class="form-input">
<input placeholder="Entrer le mot de passe"
name="password" required="" type="password">
</div>
<a href="http://localhost:8080/inscription/inscription.html">
<input id="submit" value="LOGIN" type="submit" http://localhost:8080/MAHA.html>
</a >
<p></p>
</form>
</div>
<p>
<span style="color: white;">
<label></label></span>
<span style="color: white;">
<b>Vous n'avez pas un compte</b>
</span>
<a href="http://localhost:8080/inscription/inscription.html">
<input id="submit" value="inscript" type="submit" onclick="http://localhost:8080/inscription.html"> </a> </p>
</div>
</div>
</div>
</div>
</header>
</div>
</div>
</body>
</html>
Afficher la suite