mysportsnutrition Posted June 16, 2007 Posted June 16, 2007 Please im begging some one to help me with my oscommerce website. I bought a template (oscommerce) Everything is working perfectly except that when a customer tries to regstister fills in the fields and presses enter, there is always an error with the email. even though it is the correct e mail, it tells the customer that its incorrect. How do i fix it so that they can type in any email and it will go through. really need this sorted out quickly, so if anyone is kind enough to help me it would be very much appreciated. Here is the code for the validation <?php /* $Id: validations.php,v 1.11 2003/02/11 01:31:02 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ //////////////////////////////////////////////////////////////////////////////////////////////// // // Function : tep_validate_email // // Arguments : email email address to be checked // // Return : true - valid email address // false - invalid email address // // Description : function for validating email address that conforms to RFC 822 specs // // This function is converted from a JavaScript written by // Sandeep V. Tamhankar ([email protected]). The original JavaScript // is available at [url="http://javascript.internet.com"]http://javascript.internet.com[/url] // // Sample Valid Addresses: // // [email protected] // [email protected] // "first last"@host.com // "first@last"@host.com // [email protected] // first.last@[123.123.123.123] // // Invalid Addresses: // // first [email protected] // // //////////////////////////////////////////////////////////////////////////////////////////////// function tep_validate_email($email) { $valid_address = true; $mail_pat = '^(.+)@(.+)$'; $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]"; $atom = "$valid_chars+"; $quoted_user='(\"[^\"]*\")'; $word = "($atom|$quoted_user)"; $user_pat = "^$word(\.$word)*$"; $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$'; $domain_pat = "^$atom(\.$atom)*$"; if (eregi($mail_pat, $email, $components)) { $user = $components[1]; $domain = $components[2]; // validate user if (eregi($user_pat, $user)) { // validate domain if (eregi($ip_domain_pat, $domain, $ip_components)) { // this is an IP address for ($i=1;$i<=4;$i++) { if ($ip_components[$i] > 255) { $valid_address = false; break; } } } else { // Domain is a name, not an IP if (eregi($domain_pat, $domain)) { /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD and that there's a hostname preceding the domain or country. */ $domain_components = explode(".", $domain); // Make sure there's a host name preceding the domain. if (sizeof($domain_components) < 2) { $valid_address = false; } else { $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]); // Allow all 2-letter TLDs (ccTLDs) if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) { $tld_pattern = ''; // Get authorized TLDs from text file $tlds = file(DIR_WS_INCLUDES . 'tld.txt'); while (list(,$line) = each($tlds)) { // Get rid of comments $words = explode('#', $line); $tld = trim($words[0]); // TLDs should be 3 letters or more if (eregi('^[a-z]{3,}$', $tld) == 1) { $tld_pattern .= '^' . $tld . '$|'; } } // Remove last '|' $tld_pattern = substr($tld_pattern, 0, -1); if (eregi("$tld_pattern", $top_level_domain) == 0) { $valid_address = false; } } } } else { $valid_address = false; } } } else { $valid_address = false; } } else { $valid_address = false; } if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') { if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) { $valid_address = false; } } return $valid_address; } ?> some one please help me I would also like to know how change the fields to put the united kingdom date of birth (day/month/year) rather than the American date of birth (month/ day/ yeah) SOME ONE PLEASE HELP!!
frieda Posted September 4, 2007 Posted September 4, 2007 I have the same problem. It does not accept all the email addresses. particularly the more complicated addresses are rejected. Does anyone know how to fix it?
shadow007 Posted September 4, 2007 Posted September 4, 2007 Please im begging some one to help me with my oscommerce website. I bought a template (oscommerce) Everything is working perfectly except that when a customer tries to regstister fills in the fields and presses enter, there is always an error with the email. even though it is the correct e mail, it tells the customer that its incorrect. How do i fix it so that they can type in any email and it will go through. really need this sorted out quickly, so if anyone is kind enough to help me it would be very much appreciated. Here is the code for the validation <?php /* $Id: validations.php,v 1.11 2003/02/11 01:31:02 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ //////////////////////////////////////////////////////////////////////////////////////////////// // // Function : tep_validate_email // // Arguments : email email address to be checked // // Return : true - valid email address // false - invalid email address // // Description : function for validating email address that conforms to RFC 822 specs // // This function is converted from a JavaScript written by // Sandeep V. Tamhankar ([email protected]). The original JavaScript // is available at [url="http://javascript.internet.com"]http://javascript.internet.com[/url] // // Sample Valid Addresses: // // [email protected] // [email protected] // "first last"@host.com // "first@last"@host.com // [email protected] // first.last@[123.123.123.123] // // Invalid Addresses: // // first [email protected] // // //////////////////////////////////////////////////////////////////////////////////////////////// function tep_validate_email($email) { $valid_address = true; $mail_pat = '^(.+)@(.+)$'; $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]"; $atom = "$valid_chars+"; $quoted_user='(\"[^\"]*\")'; $word = "($atom|$quoted_user)"; $user_pat = "^$word(\.$word)*$"; $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$'; $domain_pat = "^$atom(\.$atom)*$"; if (eregi($mail_pat, $email, $components)) { $user = $components[1]; $domain = $components[2]; // validate user if (eregi($user_pat, $user)) { // validate domain if (eregi($ip_domain_pat, $domain, $ip_components)) { // this is an IP address for ($i=1;$i<=4;$i++) { if ($ip_components[$i] > 255) { $valid_address = false; break; } } } else { // Domain is a name, not an IP if (eregi($domain_pat, $domain)) { /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD and that there's a hostname preceding the domain or country. */ $domain_components = explode(".", $domain); // Make sure there's a host name preceding the domain. if (sizeof($domain_components) < 2) { $valid_address = false; } else { $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]); // Allow all 2-letter TLDs (ccTLDs) if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) { $tld_pattern = ''; // Get authorized TLDs from text file $tlds = file(DIR_WS_INCLUDES . 'tld.txt'); while (list(,$line) = each($tlds)) { // Get rid of comments $words = explode('#', $line); $tld = trim($words[0]); // TLDs should be 3 letters or more if (eregi('^[a-z]{3,}$', $tld) == 1) { $tld_pattern .= '^' . $tld . '$|'; } } // Remove last '|' $tld_pattern = substr($tld_pattern, 0, -1); if (eregi("$tld_pattern", $top_level_domain) == 0) { $valid_address = false; } } } } else { $valid_address = false; } } } else { $valid_address = false; } } else { $valid_address = false; } if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') { if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) { $valid_address = false; } } return $valid_address; } ?> some one please help me I would also like to know how change the fields to put the united kingdom date of birth (day/month/year) rather than the American date of birth (month/ day/ yeah) SOME ONE PLEASE HELP!! You can rewrite validations.php with mine: <?php /* $Id: validations.php,v 1.11 2003/02/11 01:31:02 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ //////////////////////////////////////////////////////////////////////////////////////////////// // // Function : tep_validate_email // // Arguments : email email address to be checked // // Return : true - valid email address // false - invalid email address // // Description : function for validating email address that conforms to RFC 822 specs // // This function is converted from a JavaScript written by // Sandeep V. Tamhankar ([email protected]). The original JavaScript // is available at http://javascript.internet.com // // Sample Valid Addresses: // // [email protected] // [email protected] // "first last"@host.com // "first@last"@host.com // [email protected] // first.last@[123.123.123.123] // // Invalid Addresses: // // first [email protected] // // //////////////////////////////////////////////////////////////////////////////////////////////// function tep_validate_email($email) { $valid_address = true; // $mail_pat = '^(.+)@(.+)$'; // $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]"; // $atom = "$valid_chars+"; // $quoted_user='(\"[^\"]*\")'; // $word = "($atom|$quoted_user)"; // $user_pat = "^$word(\.$word)*$"; // $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$'; // $domain_pat = "^$atom(\.$atom)*$"; // // if (eregi($mail_pat, $email, $components)) { // $user = $components[1]; // $domain = $components[2]; // // validate user // if (eregi($user_pat, $user)) { // // validate domain // if (eregi($ip_domain_pat, $domain, $ip_components)) { // // this is an IP address // for ($i=1;$i<=4;$i++) { // if ($ip_components[$i] > 255) { // $valid_address = false; // break; // } // } // } // else { // // Domain is a name, not an IP // if (eregi($domain_pat, $domain)) { // /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD // and that there's a hostname preceding the domain or country. */ // $domain_components = explode(".", $domain); // // Make sure there's a host name preceding the domain. // if (sizeof($domain_components) < 2) { // $valid_address = false; // } else { // $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]); // // Allow all 2-letter TLDs (ccTLDs) // if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) { // $tld_pattern = ''; // // Get authorized TLDs from text file // $tlds = file(DIR_WS_INCLUDES . 'tld.txt'); // while (list(,$line) = each($tlds)) { // // Get rid of comments // $words = explode('#', $line); // $tld = trim($words[0]); // // TLDs should be 3 letters or more // if (eregi('^[a-z]{3,}$', $tld) == 1) { // $tld_pattern .= '^' . $tld . '$|'; // } // } // // Remove last '|' // $tld_pattern = substr($tld_pattern, 0, -1); // if (eregi("$tld_pattern", $top_level_domain) == 0) { // $valid_address = false; // } // } // } // } // else { // $valid_address = false; // } // } // } // else { // $valid_address = false; // } // } // else { // $valid_address = false; // } // if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') { // if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) { // $valid_address = false; // } // } if(preg_match("/^[_\.0-9a-z-]+@[0-9a-z-]+(\.[a-z]{2,4})+$/i",$email)) { $valid_address = true; } else { $valid_address = false; } return $valid_address; } ?> Everyone is changing the world. Everyone is a world. For everyone needs my help, PM or email if I amn't online.
shadow007 Posted September 4, 2007 Posted September 4, 2007 For your UK birthday. In catalog/create_account.php, about line 80, find: if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) { Replace with: if (checkdate(substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 0, 4)) == false) { Everyone is changing the world. Everyone is a world. For everyone needs my help, PM or email if I amn't online.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.