Authentification sur php
zbart3i
Messages postés
3
Statut
Membre
-
intoxx62 Messages postés 422 Statut Membre -
intoxx62 Messages postés 422 Statut Membre -
ce scriipt ne marche pas je sais pa prkoi je l'ai analyser tant de foix sans savoir l'erreur
aider moi svp
<html>
<title>login</title>
<head>
<script language="javascript">
function verify()
{
if (document.f1.login.value=="")
{ alert ("Vous devez donner votre login")
return false;}
if (document.f1.pass.value=="")
{alert ("Vous devez donner le mot de passe")
return false;}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form name="f1" method="post" onSubmit="return verify()" action="insertion livre.php" >
<p>login:
<input name="login" type="text" id="login">
</p>
<p>pass:
<input name="pass" type="password" id="pass">
</p>
<input type="submit" name="submit" value="login">
</form>
<?php
if(isset($_POST['submit']))
{
$login=$_POST['login'];
$pass=$_POST['pass'];
mysql_connect("localhost","root","");
mysql_select_db("bebliotheque");
$rek=mysql_query("select * from administrateur
where login='$login' and pass='$pass' ");
// Mysql_num_row is counting table row
$count=mysql_num_rows($rek);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count != 1)
{
echo "<script> alert(\"connexion impossible Nom d'utilisateur
et / ou mot de passe incorrect\") </script>";}
}
?>
</body>
</html>
table:
administrateur(login,pass)
aider moi svp
<html>
<title>login</title>
<head>
<script language="javascript">
function verify()
{
if (document.f1.login.value=="")
{ alert ("Vous devez donner votre login")
return false;}
if (document.f1.pass.value=="")
{alert ("Vous devez donner le mot de passe")
return false;}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form name="f1" method="post" onSubmit="return verify()" action="insertion livre.php" >
<p>login:
<input name="login" type="text" id="login">
</p>
<p>pass:
<input name="pass" type="password" id="pass">
</p>
<input type="submit" name="submit" value="login">
</form>
<?php
if(isset($_POST['submit']))
{
$login=$_POST['login'];
$pass=$_POST['pass'];
mysql_connect("localhost","root","");
mysql_select_db("bebliotheque");
$rek=mysql_query("select * from administrateur
where login='$login' and pass='$pass' ");
// Mysql_num_row is counting table row
$count=mysql_num_rows($rek);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count != 1)
{
echo "<script> alert(\"connexion impossible Nom d'utilisateur
et / ou mot de passe incorrect\") </script>";}
}
?>
</body>
</html>
table:
administrateur(login,pass)
A voir également:
- Authentification sur php
- Double authentification google - Guide
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Code a 6 chiffres application d'authentification instagram - Forum Instagram
- Php alert ✓ - Forum PHP