email format validation changes...
Posted by caffiend
email format validation changes... July 20, 2003 03:35PM |
Registered: 19 years ago Posts: 16 |
Here are the changes to make sure that someone has submitted an email address in a valid format. I've got probably 50 users or so who unintentionally screwed up their profile.
It should be fine, but I haven't given it a solid test yet.
It's a unified diff, just copy it into your phorum directory and apply it under unix or with cygwin for windows.
patch -p1 < validate_email.diff
remove it with
patch -R -p1 < validate_email.diff
It should be fine, but I haven't given it a solid test yet.
It's a unified diff, just copy it into your phorum directory and apply it under unix or with cygwin for windows.
patch -p1 < validate_email.diff
remove it with
patch -R -p1 < validate_email.diff
Anonymous User
Re: email format validation changes... July 22, 2003 07:29AM |
Re: email format validation changes... July 24, 2003 11:49AM |
Registered: 19 years ago Posts: 16 |
Nothing too tricky,
+ // check email address for correct syntax
+ function validate_email($email)
+ {
+ if(preg_match("/^.+@.+\..{2,3}$/", $email)){
+ return TRUE;
+ }else{
+ return FALSE;
+ }
+ }
call the function in profile.php and added a new string to english.php to reflect the error
+ // check email address for correct syntax
+ function validate_email($email)
+ {
+ if(preg_match("/^.+@.+\..{2,3}$/", $email)){
+ return TRUE;
+ }else{
+ return FALSE;
+ }
+ }
call the function in profile.php and added a new string to english.php to reflect the error
Anonymous User
Re: email format validation changes... July 26, 2003 06:50AM |
Re: email format validation changes... July 26, 2003 04:12PM |
Registered: 19 years ago Posts: 16 |
Re: email format validation changes... July 26, 2003 05:22PM |
Registered: 19 years ago Posts: 16 |
Thomas, does this make sense? I don't think that all the coffee in the world today would be enough...
in profile.php I added
// check for valid email syntax
if(!is_email($safe_email)){
$EditError=$lEmailSyntax;
}
and in register.php
if(!is_email($safe_email)){
$Error=$lEmailSyntax;
}else{
$SQL="select username, email from ".$pho_main."_auth where (upper(username)=upper('$safe_user') or upper(email)=upper('$safe_email'))";+ //run query
$q->query($DB,$SQL);
.......
.......
}
if so I'll post an updated patch....
in profile.php I added
// check for valid email syntax
if(!is_email($safe_email)){
$EditError=$lEmailSyntax;
}
and in register.php
if(!is_email($safe_email)){
$Error=$lEmailSyntax;
}else{
$SQL="select username, email from ".$pho_main."_auth where (upper(username)=upper('$safe_user') or upper(email)=upper('$safe_email'))";+ //run query
$q->query($DB,$SQL);
.......
.......
}
if so I'll post an updated patch....
Anonymous User
Re: email format validation changes... July 27, 2003 07:23AM |
Sorry, you do not have permission to post/reply in this forum.