Codice PHP:
//Verifico la presenza dell'e-mail nel database
$query = "SELECT * FROM members WHERE email='email'";
$result = mysql_query($sql);
$verify = mysql_fetch_row($result);
if(count($verify))//Verifico se l'e-mail esiste nel database almeno una volta
{
echo "Impossibile completare la registarzione: qualcuno ha già efettuato la registarzione con l'e-mail '$mail'; utilizzane un'altra!";
}else{//altrimenti eseguo la query
//send member information
$message =
'
Thanks for registering.
Please keep the following for your records:
Username: '.$_REQUEST['email'].'
Password: '.$password;
//mail member
@mail($_REQUEST['email'],'Member Registration',$message,'From:'.$settings['email']);
$mailmessage = '<div align=center class="pageSubTitle">Username and Password sent to '.$_REQUEST['email'].'</div>';
@mail($settings['email'],'How did you hear about us',$_REQUEST['hear_about'],'From:'.$settings['email']);
$insertSQL = sprintf("INSERT INTO membro (name, address, city, `state`, zip, active, email, password, phone) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['address'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['state'], "text"),
GetSQLValueString($_POST['zip'], "text"),
GetSQLValueString($_POST['active'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($password, "text"),
GetSQLValueString($_POST['phone'], "text"));
mysql_select_db($database_myconn, $myconn);
$Result1 = mysql_query($insertSQL, $myconn) or die(mysql_error());
grazie