andy8828
12-18-2010, 04:55 AM
Hello,
I have a greeting card web page which it used to work fine before in 4 or 5 years ago(It now hosts at oneandone.com).
But now it has the "invalid check email address" error when trying to click on the submit "Preview eCard" button. The php script code may be not compatible with the new PHP server. Can someone help me to fix this email check error? Thanks.
Here is part of the php code and the URL of the web page http://www.uswebcity.com/greetings/index.php.
<?php
function validate_email ($address) {
return (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',
$address));
}
function checkemail($address){
if (!validate_email($address)) {
?>
<html><head><title>Invalid Email Address</title></head>
<body bgcolor=white>
<h3>Invalid Email Address:</h3>
<p>Sorry, the email address <font color=red><?php print $address ?></font> is invalid.</p>
<form>
<INPUT TYPE="button" VALUE="Go Back" onClick="history.back()">
</form>
</body></html>
<?php
exit;
}
}
checkemail($recipientemail);
checkemail($senderemail);
$message = trim($message);
$showmessage = stripslashes($message);
$message = htmlentities($showmessage);
I have a greeting card web page which it used to work fine before in 4 or 5 years ago(It now hosts at oneandone.com).
But now it has the "invalid check email address" error when trying to click on the submit "Preview eCard" button. The php script code may be not compatible with the new PHP server. Can someone help me to fix this email check error? Thanks.
Here is part of the php code and the URL of the web page http://www.uswebcity.com/greetings/index.php.
<?php
function validate_email ($address) {
return (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',
$address));
}
function checkemail($address){
if (!validate_email($address)) {
?>
<html><head><title>Invalid Email Address</title></head>
<body bgcolor=white>
<h3>Invalid Email Address:</h3>
<p>Sorry, the email address <font color=red><?php print $address ?></font> is invalid.</p>
<form>
<INPUT TYPE="button" VALUE="Go Back" onClick="history.back()">
</form>
</body></html>
<?php
exit;
}
}
checkemail($recipientemail);
checkemail($senderemail);
$message = trim($message);
$showmessage = stripslashes($message);
$message = htmlentities($showmessage);