voilà le début de code de ma page de formulaire :
<?php require_once('Connections/agorap.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"] == "form1" )) {
$insertSQL = sprintf("INSERT INTO enquetes (ID, sexe, age, `titre_inscription`, `titre_inscription2`, `titre_inscription3`, `titre_inscription4`, `titre_inscription5`, `titre_inscription6`, `titre_inscription7`, `titre_inscription8`, `titre_inscription9`, `titre_inscription10`, `titre_inscription11`, `titre_inscription12`, `titre_inscription13`, `titre_inscription_autre`, `date`, `comment_connu`, `comment_connu_autre`, `utilisation_message`, `pose_question`, `repondu_question`, `communication_info`, `recup_document`, `contact_auteur`, `a_quoi_sert`, `a_quoi_sert2`, `a_quoi_sert3`, `a_quoi_sert4`, `a_quoi_sert5`, suggestion, Nom, Prenom, Organisme) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['ID'], "int" ),
GetSQLValueString($_POST['sexe'], "text" ),
GetSQLValueString($_POST['age'], "text" ),
GetSQLValueString($_POST['titre_inscription'], "text" ),
GetSQLValueString($_POST['titre_inscription2'], "text" ),
GetSQLValueString($_POST['titre_inscription3'], "text" ),
GetSQLValueString($_POST['titre_inscription4'], "text" ),
GetSQLValueString($_POST['titre_inscription5'], "text" ),
GetSQLValueString($_POST['titre_inscription6'], "text" ),
GetSQLValueString($_POST['titre_inscription7'], "text" ),
GetSQLValueString($_POST['titre_inscription8'], "text" ),
GetSQLValueString($_POST['titre_inscription9'], "text" ),
GetSQLValueString($_POST['titre_inscription10'], "text" ),
GetSQLValueString($_POST['titre_inscription11'], "text" ),
GetSQLValueString($_POST['titre_inscription12'], "text" ),
GetSQLValueString($_POST['titre_inscription13'], "text" ),
GetSQLValueString($_POST['titre_inscription_autre'], "text" ),
GetSQLValueString($_POST['date'], "text" ),
GetSQLValueString($_POST['comment_connu'], "text" ),
GetSQLValueString($_POST['comment_connu_autre'], "text" ),
GetSQLValueString($_POST['utilisation_message'], "text" ),
GetSQLValueString($_POST['pose_question'], "text" ),
GetSQLValueString($_POST['repondu_question'], "text" ),
GetSQLValueString($_POST['communication_info'], "text" ),
GetSQLValueString($_POST['recup_document'], "text" ),
GetSQLValueString($_POST['contact_auteur'], "text" ),
GetSQLValueString($_POST['a_quoi_sert'], "text" ),
GetSQLValueString($_POST['a_quoi_sert2'], "text" ),
GetSQLValueString($_POST['a_quoi_sert3'], "text" ),
GetSQLValueString($_POST['a_quoi_sert4'], "text" ),
GetSQLValueString($_POST['a_quoi_sert5'], "text" ),
GetSQLValueString($_POST['suggestion'], "text" ),
GetSQLValueString($_POST['Nom'], "text" ),
GetSQLValueString($_POST['Prenom'], "text" ),
GetSQLValueString($_POST['Organisme'], "text" ));