Forum Moderators: coopster
But this control should be because e-mail should be used only once in db. is this correct?
Not sure I got you loud and clear
anyway if the username or email or username associated with eamil are used as a form of authentication
A user could be allowed to enter a modification upon posting his/her username and email
as such it should be considered as a pair
and that pair as a pair (username and email) needs to be the new username and passord
its an update not an isert therefore not a duplicate
if (eregi ('^[[:alnum:]][a-z0-9_\.\-]*@[a-z0-9\.\-]+\.[a-z]{2,4}$', trim($_POST['email']))) {//check input
$e = $_POST['email'];if ($e!== $_SESSION['email']){ // if the email address was changed check it's availability now
$query = "SELECT anyColumn FROM table WHERE email='$e'";
$result = mysql_query($query) or trigger_error ("my error");
if (mysql_affected_rows() == 1) {
echo 'This email address is already registered. Please use another email address.';
}}
} else { //validation failed
echo 'Please provide your email.';
}
Then if the email session variable is no longer needed I'd unset it.