I hope I am able to describe this properly, but I inherited a form that is js and passes to a php mail() function. I'm pretty new to javascript also. I usually do all my forms in php tossing into mysql.
1) I have one field which is for "phone number", and due to the fact that this site deals with international numbers, country codes and people that possibly enter with a different syntax, I need to keep it as a "text box" entry.
2) There is one user ( or bot ) that keeps entering a certain value of 1233456 and this adds up to 50+ per day.
3) Below is the only checking that is being done:
The person that wrote this is just looking for any entry of characters that is >2, and the only validation of this whole form is below, in which he is looking for the @ sign, to get an e-mail address.
4) What I would like to do, and this is what I am not sure about and asking for help is to just let this person/bot to keep doing what is being done...but I would just like to Silently Discard and entry that contains the: 123456 from passing thru the mail() function, yet make it look like it was successful to the user (bot) in which this would keep them happy, thinking it is doing it.
Thank-you in advance, and any help for a newbie appreciated !!
1) I have one field which is for "phone number", and due to the fact that this site deals with international numbers, country codes and people that possibly enter with a different syntax, I need to keep it as a "text box" entry.
2) There is one user ( or bot ) that keeps entering a certain value of 1233456 and this adds up to 50+ per day.
3) Below is the only checking that is being done:
Code:
/*if name is blank or less than two characters if ($_POST['phone-number']=='' || strlen($_POST['phone-number'])<2 || $_POST['phone-number']=='phone number' ) { $errors[] = 'Phone Number is required.'; }*/
Code:
<?php function alpha_numeric($str) { return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ? FALSE : TRUE; } function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } ?>
Thank-you in advance, and any help for a newbie appreciated !!
Comment