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
| $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("REPLACE INTO visiteurs (visiteur, passe) VALUES (%s, %s)",
GetSQLValueString($_POST['nom'], "text"),
GetSQLValueString($_POST['passe'], "text"));
mysql_select_db($database_conncz, $conncz);
$Result1 = mysql_query($insertSQL, $conncz) or die(mysql_error());
$insertGoTo = "conf.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$colname_Recordset1 = "-1";
if (isset($_POST['passe'])) {
$colname_Recordset1 = $_POST['passe'];
}
mysql_select_db($database_conncz, $conncz);
$query_Recordset1 = sprintf("SELECT * FROM visiteurs WHERE passe = %s", GetSQLValueString($colname_Recordset1, "text"));
$Recordset1 = mysql_query($query_Recordset1, $conncz) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1); |
Partager