vcoila ou j en suis mais j ai un soucis:
quand je valide le formulaire voila l erreur:
Code : Tout sélectionner
Warning: sprintf() [function.sprintf]: Too few arguments in C:\wamp\www\membres\inscription.php on line 54
Query was empty<?php
require("connections/localhost.php");
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO membres (membre_id, membre_pseudo, membre_mdp, membre_mail, membre_inscription, membre_naissance, membre_msn, membre_yahoo, membre_aim, membre_localisation, membre_profession, membre_avatar, membre_biographie, membre_signature) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,)",
GetSQLValueString($_POST['membre_pseudo'], "text"),
GetSQLValueString($_POST['membre_mdp'], "text"),
GetSQLValueString($_POST['membre_mail'], "text"),
GetSQLValueString($_POST['membre_naissance'], "text"),
GetSQLValueString($_POST['membre_msn'], "text"),
GetSQLValueString($_POST['membre_yahoo'], "text"),
GetSQLValueString($_POST['membre_aim'], "text"),
GetSQLValueString($_POST['membre_localisation'], "text"),
GetSQLValueString($_POST['membre_profession'], "text"),
GetSQLValueString($_POST['membre_biographie'], "text"),
GetSQLValueString($_POST['membre_signature'], "text"));
mysql_select_db($database_localhost, $localhost);
$Result1 = mysql_query($insertSQL, $localhost) or die(mysql_error());
$insertGoTo = "inscription.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">pseudo:</td>
<td><input type="text" name="membre_pseudo" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">password:</td>
<td><input type="password" name="membre_mdp" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">E-mail:</td>
<td><input type="text" name="membre_mail" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">date de naissance:</td>
<td><input type="text" name="membre_naissance" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">msn:</td>
<td><input type="text" name="membre_msn" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">yahoo:</td>
<td><input type="text" name="membre_yahoo" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">aim:</td>
<td><input type="text" name="membre_aim" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">localisation:</td>
<td><input type="text" name="membre_localisation" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">profession:</td>
<td><input type="text" name="membre_profession" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">biographie:</td>
<td><input type="text" name="membre_biographie" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">signature:</td>
<td><input type="text" name="membre_signature" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Insérer un enregistrement" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>