Cette page a fonctionné comme un charme pendant des années ... entrez l'identifiant de l'utilisateur et le mot de passe correspondants et vous serez redirigé vers votre répertoire. Maintenant, soudainement, toutes les tentatives de connexion - valides ou non - font que la page reste statique ... pas de message, pas de redirection, rien.Mon login PHP ne fonctionne plus
Rien dans le code n'a changé, il ne fonctionne tout simplement plus. Cela pourrait-il être le résultat d'une sorte de changement du côté du serveur? Oui, je sais que ce n'est pas super sécurisé, mais c'était assez bon pour nos besoins. Je suis certainement ouvert à de meilleures suggestions. J'en ai juste besoin pour travailler ... et continuer à travailler.
Soyez gentil! Je ne sais presque rien de la programmation.
Voici le code de la page:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link href="ilium.css" rel="stylesheet" media="screen">
<title>Ilium: Client Login</title>
</head>
<body bgcolor="#bfbfcc" background="img/loginbg.gif">
<?php
/* init vars */
$userExists = false;
$userIndex = -1;
$authenicated = false;
/***********************************************
* edit this to add new users/password *
* - add user/pass/directory to the array *
* below: must be in same array index to work *
***********************************************/
$user = array('foo', 'bar');
$pass = array('foo', 'bar');
$directory = array('foo', 'bar');
// run user/pass check if data passed
if (isset($username) && isset($password))
{
// check if user name exists
for ($i = 0; $i < count($user); $i++)
{
if ($user[$i] == $username)
{
$userExists = true;
$userIndex = $i;
break;
}
}
// so user exists, now test password
if ($userExists)
{
$message = $message . "Username Valid<br>\n";
if ($pass[$userIndex] == $password)
{
$authenicated = true;
$link = "/incoming/clients050203/" . $directory[$userIndex] . "/";
$message = $message . "Password Valid - Redirecting to your folder...<br>\n";
}
else
{
$message = $message . "Incorrect Password<br>\n";
}
}
else
{
$message = $message . "Incorrect User Name<br>\n";
}
}
?>
<?php
// user has been authenicated - move them to the correct directory
if ($authenicated)
{
echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=" . $link . "\">";
}
?>
<img src="img/spacer.gif" alt="" width="1" height="112" border="0">
<form action="login.php" method="post">
<table width="496">
<tr>
<td width="100"></td>
<td colspan="4" width="469"><img src="img/please.gif" alt="" width="469" height="19" border="0"></td>
</tr>
<tr>
<td width="100"><img src="img/spacer.gif" alt="" width="100" height="1" border="0"></td>
<td width="227">
<img src="img/spacer.gif" alt="" width="227" height="1" border="0"><br>
</td>
<td align="right" valign="top" width="84"><input type="text" name="username" size="12"><br></td>
<td width="43"><img src="img/spacer.gif" alt="" width="43" height="1" border="0"><br>
<br>
</td>
<td align="right" valign="top" width="109"><input type="password" name="password" size="16">
<p><br>
</p>
</td>
</tr>
<tr>
<td width="100"></td>
<td valign="top" width="227"><div class="messages"><?=$message?></div></td>
<td width="84"><br>
</td>
<td width="43"><br>
</td>
<td align="right" width="109"><input type="image" src="img/enter.gif" ALT="enter"><br>
<br>
<br>
<br>
<br>
</td>
</tr>
</table>
</form>
</body>
</html>
Effectivement, il y avait un déménagement de serveur ce week-end. Merci d'avoir pris le temps de regarder, Chris. Travaux! –