par
ledruid » 28 févr. 2006, 22:54
merci ,j'ai corrigé , mais le probleme ne change pas... j'ai beau chercher je ne comprend pas..
si je reprend mon ancien code, ou dois-je mettre la fonction md5 ?
(le code fonctione tres biens , mais je ne sai spas ou mettre la fonction..)
Merci encore de votre aide.. c'est tres simpa
<?php require_once('*****_SQL.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO inscription (numero, sexe, pseudo, password, date_j, date_m, date_a, pays, code_postal, ville, email) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['numero'], "int"),
GetSQLValueString($_POST['sexe'], "text"),
GetSQLValueString($_POST['pseudo'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['date_j'], "int"),
GetSQLValueString($_POST['date_m'], "int"),
GetSQLValueString($_POST['date_a'], "int"),
GetSQLValueString($_POST['pays'], "text"),
GetSQLValueString($_POST['code_postal'], "text"),
GetSQLValueString($_POST['ville'], "text"),
GetSQLValueString($_POST['email'], "text"));
mysql_select_db($database_*****_SQL, $*****_SQL);
$Result1 = mysql_query($insertSQL, $*****_SQL) or die(mysql_error());
}
?>
merci ,j'ai corrigé , mais le probleme ne change pas... j'ai beau chercher je ne comprend pas..
si je reprend mon ancien code, ou dois-je mettre la fonction md5 ?
(le code fonctione tres biens , mais je ne sai spas ou mettre la fonction..)
Merci encore de votre aide.. c'est tres simpa
[php]
<?php require_once('*****_SQL.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO inscription (numero, sexe, pseudo, password, date_j, date_m, date_a, pays, code_postal, ville, email) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['numero'], "int"),
GetSQLValueString($_POST['sexe'], "text"),
GetSQLValueString($_POST['pseudo'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['date_j'], "int"),
GetSQLValueString($_POST['date_m'], "int"),
GetSQLValueString($_POST['date_a'], "int"),
GetSQLValueString($_POST['pays'], "text"),
GetSQLValueString($_POST['code_postal'], "text"),
GetSQLValueString($_POST['ville'], "text"),
GetSQLValueString($_POST['email'], "text"));
mysql_select_db($database_*****_SQL, $*****_SQL);
$Result1 = mysql_query($insertSQL, $*****_SQL) or die(mysql_error());
}
?>
[/php]