vorrei che appena un nuovo utente si registra compaia questo:
grazie per esserti registrato
Utente:
La tua password:
questo è il form:
Codice PHP:
<?php require_once('../Connections/connessione_registrazione_utente.php'); ?>
<?php
mysql_select_db($database_connessione_registrazione_utente, $connessione_registrazione_utente);
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"] == "formregistrazione")) {
$nome=$_POST['nome'];
$utente=$_POST['utente'];
$password=$_POST['password'];
$regione=$_POST['regione'];
$res = mysql_query("SELECT utente FROM tabella WHERE utente = '$utente'");
if(mysql_num_rows($res) > 0)
{
die("L'utente esiste gia");
} else {
$insertSQL = sprintf("INSERT INTO tabella (nome, utente, password, regione) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['nome'], "text"),
GetSQLValueString($_POST['utente'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['regione'], "text"));
mysql_select_db($database_connessione_registrazione_utente, $connessione_registrazione_utente);
$Result1 = mysql_query($insertSQL, $connessione_registrazione_utente) or die(mysql_error());
$insertGoTo = "../index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
sò che è un comando echo ma nn saprei inserirlo