if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO clients (ID, nom, prenom, adresse, ville, cp, tel, email, pass)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, MD5(%s))",
GetSQLValueString($_POST['ID'], "int"),
GetSQLValueString($_POST['nom'], "text"),
GetSQLValueString($_POST['prenom'], "text"),
GetSQLValueString($_POST['adresse'], "text"),
GetSQLValueString($_POST['ville'], "text"),
GetSQLValueString($_POST['cp'], "text"),
GetSQLValueString($_POST['tel'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['pass'], "text"));<?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['email'])) {
$loginUsername=$_POST['email'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "../moi/commande_confirmation.php";
$MM_redirectLoginFailed = "login.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_Connexion, $Connexion);
$LoginRS__query=sprintf("SELECT email, pass FROM clients WHERE email=%s AND pass=MD5(%s)",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $Connexion) 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;<form name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <input name="email" type="text" id="email" size="17"> <br> <input name="pass" type="password" id="pass" size="17"/> <input type="hidden" name="MD5pass" value="" /> <input type="submit" name="button" id="button" value="ok"> </form>

Il trouve pas ta fonction, elle n'est pas déclaré.felta a écrit:
comment lire le message d'erreur STP?
merci
fanny
$LoginRS__query=sprintf("SELECT email, pass FROM clients WHERE email=%s AND pass=MD5(%s)",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 

<?php require_once('../Connections/ConnexionMa.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?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['email'])) {
$loginUsername=$_POST['email'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "../moi/commande_confirmation.php";
$MM_redirectLoginFailed = "login.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_ConnexionMa, $ConnexionMa);
$LoginRS__query=sprintf("SELECT email, pass FROM clients WHERE email=%s AND pass=MD5(%s)",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $ConnexionMa) 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 );
}
}
?>
<html><!-- InstanceBegin template="/Templates/ModelePublic.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
</head>
<body>
<form name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
<input name="email" type="text" id="email" size="17">
<br>
<input name="pass" type="password" id="pass" size="17"/>
<input type="hidden" name="MD5pass" value="" />
<input type="submit" name="button" id="button" value="ok">
</form>
</table><?php echo $LoginRS__query; ?>
</body>
Sujets Similaires: 