tobyheywood
IS-IT--Management
Hello,
The follow snippet of code is (was) used to check for carriage returns (\r) and newlines (\n) in an email address entered by a user.
For some reason this now always evaluates $efrom as containing a \r or \n. I see no reason why the form data would contain these and am hoping someone can shed some light on this.
<- CODE WHICH STORES FORM VARIABLES ->
<- CODE TO CHECK EMAIL ADDRESS ->
Removal of the above email checking code, results in the email being sent successfully.
Any help would be appreciated.
Regards
Toby Heywood
The follow snippet of code is (was) used to check for carriage returns (\r) and newlines (\n) in an email address entered by a user.
For some reason this now always evaluates $efrom as containing a \r or \n. I see no reason why the form data would contain these and am hoping someone can shed some light on this.
<- CODE WHICH STORES FORM VARIABLES ->
Code:
$visitor['Name'] = addslashes($_POST['Name']);
$visitor['Email'] = addslashes($_POST['Email']);
$visitor['Tel'] = addslashes($_POST['Telephone']);
Code:
$efrom = stripslashes($visitor['Email']);
if (ereg("\\r",$efrom) || ereg("\\n",$efrom) ) {
$messageok = '0';
// This is always returned
} else {
$messageok = '1';
}
Removal of the above email checking code, results in the email being sent successfully.
Any help would be appreciated.
Regards
Toby Heywood