Ok...I have a php file that I use to submit form data to me via E-Mail. I have 2 questions...First, how can I alter it to better validate their E-Mail (right now it just makes sure that it exists) second, if someone puts quotes, etc in the message, it sends as \"actually you didn't validate anything, you jsut made sure they typed something in.
I cahnged it to make sure the email is in correct syntax and also made it so the \' didn't come to you.
I used stripslashes() if you wanted to look at it.Awesome...that is WAY better. The only problem is...I don't understand part of it. Could you break down this line, and tell me what it means?
if (!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i',
$_POST['email']))well that is called regular expression. it breaks down the email addy and sees if it has illegal characters in it, before and after the @ sign.
you need to read up on regular expreessions as it is way vast and deep. awesome code though if you use it, makes things a lot easier.
I cahnged it to make sure the email is in correct syntax and also made it so the \' didn't come to you.
I used stripslashes() if you wanted to look at it.Awesome...that is WAY better. The only problem is...I don't understand part of it. Could you break down this line, and tell me what it means?
if (!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i',
$_POST['email']))well that is called regular expression. it breaks down the email addy and sees if it has illegal characters in it, before and after the @ sign.
you need to read up on regular expreessions as it is way vast and deep. awesome code though if you use it, makes things a lot easier.