1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
<?php require_once('../Connections/mb.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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "membre")) {
$insertSQL = sprintf("INSERT INTO membre (prenom1, prenom2, nom1, nom2, email, pseudo, password, sexe, jour, mois, annee, rue, numrue, ville, cp, province, pays, telephone) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['prenom1mem'], "text"),
GetSQLValueString($_POST['prenom2mem'], "text"),
GetSQLValueString($_POST['nom1mem'], "text"),
GetSQLValueString($_POST['nom2mem'], "text"),
GetSQLValueString($_POST['mailmembre'], "text"),
GetSQLValueString($_POST['pseudo'], "text"),
GetSQLValueString($_POST['mot_de_passe'], "text"),
GetSQLValueString($_POST['sexe'], "text"),
GetSQLValueString($_POST['jourmem'], "int"),
GetSQLValueString($_POST['moismem'], "text"),
GetSQLValueString($_POST['anneemem'], "int"),
GetSQLValueString($_POST['rue'], "text"),
GetSQLValueString($_POST['numrue'], "int"),
GetSQLValueString($_POST['ville'], "text"),
GetSQLValueString($_POST['cp'], "int"),
GetSQLValueString($_POST['province'], "text"),
GetSQLValueString($_POST['pays'], "text"),
GetSQLValueString($_POST['telephone'], "int"));
mysql_select_db($database_mb, $mb);
$Result1 = mysql_query($insertSQL, $mb) or die(mysql_error());
<form action="<?php echo $editFormAction; ?>" id="membre" name="membre" method="POST">
<input name="prenom1mem" type="text" id="prenom1mem" />
<label for="prenom1mem"></label>
<span class="Style80">2°prénom </span>
<input name="prenom2mem" type="text" id="prenom2mem" />
<label for="prenom2mem"></label> |
Partager