Problème message erreur

snakykyle Messages postés 5 Date d'inscription jeudi 11 mars 2004 Statut Membre Dernière intervention 3 mai 2006 - 18 déc. 2004 à 12:11
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 - 19 déc. 2004 à 21:56
Bonjour tout le monde,

J'aimerai savoir comment je pourrai afficher un message "Login ou mot de passe érronés" (au niveau du ICI en rouge dans le code ci dessous) apres une fausse saisie de la part de l'utilisateur lors du rafraichissement de la meme page!

Voici mon code de ma page:

<?php require_once('Connections/ConnexionMonSite.php'); ?>
<?php
// *** Validate request to login to this site.
session_start();

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}

if (isset($_POST['log'])) {
$loginUsername=$_POST['log'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "id_statut";
$MM_redirectLoginSuccess = "page/index.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_ConnexionMonSite, $ConnexionMonSite);

$LoginRS__query=sprintf("SELECT log, pass, id_statut FROM usr_profil WHERE log='%s' AND pass='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));

$LoginRS = mysql_query($LoginRS__query, $ConnexionMonSite) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {

$loginStrGroup = mysql_result($LoginRS,0,'id_statut');

//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;

//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/index.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Document sans titre</title>
<!-- InstanceEndEditable --><style type="text/css">
<!--
.Style3 {font-size: 12px}
.Style5 {
font-family: Arial, Verdana, Helvetica;
font-size: 11px;
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<link href="Templates/MonSitecss.css" rel="stylesheet" type="text/css">
<!-- InstanceEndEditable -->
<link href="MonSitecss.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Style6 {font-size: xx-small}
-->
</style>
</head>

<!--DWLayoutTable-->
----

<!--DWLayoutEmptyCell-->,
<!--DWLayoutEmptyCell-->

<!--DWLayoutTable-->

<!--DWLayoutTable-->

<!--DWLayoutTable-->

<!--DWLayoutTable-->
----

<table width="100%" border="1" bordercolor="#B7BADD">
----, <!-- InstanceBeginEditable name=\"Menu\" -->
<table width=\"100%\" border=\"1\" bordercolor=\"#CCCFE2\">
----

NAVIGATION

<!-- InstanceEndEditable --></td>
</tr>
</table></td>
<td width="5" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="490" valign="top"><!-- InstanceBeginEditable name="Milieu" -->


<!-- InstanceEndEditable --></td>
<td width="5" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="150" valign="top"><!-- InstanceBeginEditable name="Menudroi" -->
<form name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<table width="100%" border="1" bordercolor="#CCCFE2">
----, :: Connexion :: </td>

----

ICI
Login:

Password:

,

----

</form></td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
</table>

<!-- InstanceEnd -->
</html>

Merci d'avance!

Bye
Ben

1 réponse

cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
19 déc. 2004 à 21:56
Salut ;-)

Si ton problème vient du rafraîchissement :

ob_start(); tout en haut de la page

ob_end_flush(); tout en bas.

a ++

Vulgarisation informatique : Entraide, dépannage et vulgarisation informatique
0
Rejoignez-nous