par
lorenzo75 » 06 oct. 2006, 19:19
Bonjour.
Je cherche à rediriger les utilisateurs qui se connectent sur la même page, avec les mêmes valeurs : destinations.php?id=4&pays=France.
Avec le code actuel, l'utilisateur est redirigé sur destinations.php! Mais sans les valeurs actuelles id et pays!!!
code:
_____________
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['photographe'])) {
$loginUsername=$_POST['photographe'];
$password=$_POST['mdp'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "destination.php";
$MM_redirectLoginFailed = "destination.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_millimetre, $millimetre);
$LoginRS__query=sprintf("SELECT photographe, password FROM `user` WHERE photographe=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $millimetre) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
__________________________
<form id="login" name="login" method="POST" action="<?php echo $loginFormAction; ?>">
<?php if ($totalRows_user == 0) { // Show if recordset empty ?>
<table width="100%" border="0" cellpadding="0" cellspacing="5">
<tr>
<td>
<input name="photographe" type="text" class="Style117" id="photographe" onclick="this.value=''" value="Identifiant" size="15"/>
</td>
<td><input name="mdp" type="password" class="Style117" id="mdp" onclick="this.value=''" value="Mot de" size="15"/></td>
<td><a href="javascript:document.login.submit()">OK</a></td>
</tr>
<tr>
<td colspan="3" align="right">
<span class="Style116">Créer un identifiant <span class="Style115">I</span> Mot de passe oublié </span>
</td>
</tr>
</table>
<?php } // Show if recordset empty ?>
</form>
___________________________
Quelqu'un pourrait il m'aider??
Merci
Bonjour.
Je cherche à rediriger les utilisateurs qui se connectent sur la même page, avec les mêmes valeurs : destinations.php?id=4&pays=France.
Avec le code actuel, l'utilisateur est redirigé sur destinations.php! Mais sans les valeurs actuelles id et pays!!!
code:
_____________
[php]<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['photographe'])) {
$loginUsername=$_POST['photographe'];
$password=$_POST['mdp'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "destination.php";
$MM_redirectLoginFailed = "destination.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_millimetre, $millimetre);
$LoginRS__query=sprintf("SELECT photographe, password FROM `user` WHERE photographe=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $millimetre) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>[/php]
__________________________
[php]<form id="login" name="login" method="POST" action="<?php echo $loginFormAction; ?>">
<?php if ($totalRows_user == 0) { // Show if recordset empty ?>
<table width="100%" border="0" cellpadding="0" cellspacing="5">
<tr>
<td>
<input name="photographe" type="text" class="Style117" id="photographe" onclick="this.value=''" value="Identifiant" size="15"/>
</td>
<td><input name="mdp" type="password" class="Style117" id="mdp" onclick="this.value=''" value="Mot de" size="15"/></td>
<td><a href="javascript:document.login.submit()">OK</a></td>
</tr>
<tr>
<td colspan="3" align="right">
<span class="Style116">Créer un identifiant <span class="Style115">I</span> Mot de passe oublié </span>
</td>
</tr>
</table>
<?php } // Show if recordset empty ?>
</form>
[/php]
___________________________
Quelqu'un pourrait il m'aider??
Merci