Contact form in PHP website gives errors

Status
Not open for further replies.

f4n3

Active Member
106
2010
11
0
Hi guys,
I've recently incorporated a contact form in a PHP website. Everything looks OK but when I click the Submit button I get the following errors:
contact-1.png


fgcontactform.php
on line
548
this is line 548
Code:
{
        return eregi("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email);
    }
class.phpmailer.php
on line
470
this is line 470
Code:
 $toArr = split(',', $to);
does anyone have an idea what's causing this?
 
3 comments
They are deprecated functions and they shouldn't be used since they are going to be removed in future versions.

Instead of eregi, use preg_match, replace code with:
PHP:
{
        return preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $email);
    }

Same goes for the split function too, instead of that use explode function, replace with:
PHP:
 $toArr = explode(',', $to);
 
Status
Not open for further replies.
Back
Top