Bonjour,
Etant débutant dans ce langage ne m'en voulez pas si la question vous parait bebete.
Je n'arrive pas à vérifier si les données saisies par l'utilisateur sont exactes ou non.
Mon autre problème est que je n'arrive as à ouvrir une page html via un script PHP sans passer par le click sur un lien.
Voila les 2 sources (HTML et PHP) :
<html>
<!-- Created on: 24/04/2006 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Page d'identification pour l'access а QU@LIPROD</title>
<meta name="Page d'identification">
<meta name="Beaudier Alexandre">
</head>
<body bgcolor="#006699">
<table border=0 cellpadding=0 cellspacing=0 summary="">
<tr>
<td width=124 height=93><a href=".../bloblo.html"><img src="logo_ft1.gif" border="0" width="123" height="100" alt=""></a></td>
<td align=right width=760 height=93><h1><font color="#ff9933"><b><u><i><big>QU@LIPROD</big></i></u></b></font></h1></td>
<td width=500 height=93 align=right valign=top><a href=".../blabla.html"><img src="logo_intranoo.bmp" border="0" width="120" height="30" alt=""></a></td>
</tr>
</table><br /><br /><hr size="5" color="red" /><br /><br /><br /><br /><br /><br /><br /><br />
<form name="Form_envoi" action="verification.php" method="post">
<center><table border=0 cellpadding=0 bgcolor=#C0C0C0 summary="">
<tr>
<td colspan=5><font size="5"><b><big><div style="text-align: center">IDENTIFICATION</div></big></b></font></td>
</tr>
<tr>
<td><font size="4"><b>Identifiant :</b></font></td>
<td><input type="text" name="edt_log" size="20" maxlength="50">
</td>
<td><font size="4"><b>Mot de passe :</b></font></td>
<td><input type="password" name="edt_password" size="20" maxlength="50">
</td>
<td width=30></td>
<td><input type="submit" value="VALIDER"></td>
</tr>
</table>
</form>
</body>
</html>
et le PHP
<?php
session_start();
$mdp = $edt_password;
session_register("mdp");
$conn=mysql_connect("10.141.169.3","Alexandre","mayfair");
// ou mysqlp_connect(...) qui ouvre une connection persistante
//mais l'inconvénient est que celle-ci se déconnection au bout d'un temps d'inactivité
if (! $conn)
die("impossible de se connecter à mysql");
$database="qualiprod";
mysql_select_db($database,$conn)
or die("impossible d'ouvrir \"$database\" ".mysql_error());
$query="SELECT Niveau_access FROM accessibilite WHERE Mot_de_passe='$mdp'";
$resultat=mysql_query($query,$conn);
$a_row=mysql_fetch_array($resultat);
if ($a_row==0)
{fopen("http://localhost/Application%20web/prout/Page_principale_qualiprod.html","r");}
elseif ($a_row==1)
{fopen("http://localhost/Application%20web/prout/liste_equipe.php","r");}
?>
Merci d'avance pour vos réponses.
Partager