PHP - Using To Indicate 5-10 Charaters
I would like to know how I can use the code below to indicate only a range of 5 to 10 characters.
Code: [Select] else if(strlen($_POST["username"]) 5,10){ echo "<p> </p><p> </p><p> </p><br />Please go back, USERNAME is too short! MUST BE BETWEEN 5 to 10 characters.<p> </p><p> </p><a href='javascript:javascript:history.go(-1)'>Click here to go back to previous page</a>"; Thanks Similar TutorialsHi, I'm sorry to bother you with this request for help. I bought a XML driven Flash website template with an integrated contact form. Even though the contact.php seems pretty secure I receive emails telling me that someone tried to send emails but they contained no recipient addresses, and therefore no delivery could be attempted. So far, it seems as if the validation process in the php and preg_match command seem to work. Never the less those messages keep getting on my nerve. The Failed delivery emails I get look like this: ---------- Date: Mon, 20 Dec 2010 08:12:09 +0100 Message-Id: <E1PUZuj-0005zp-8c@mydomain.com> To: Subject: X-PHP-Script: www.mydomain.com/contact.php MIME-Version: 1.0 Content-type: text/html; charset=windows-1251 From: ---------- As you can see spam protection by filtering the email characters with preg_match has its limits too. The interesting thing is that the sender (E1PUZuj-0005zp-8c) is (of course) changing but only in the last digits. I received about 200 emails with exact the same beginning. So the bot seems to follow an ongoing pattern. I wonder now, if there is a way to set a command to exclude (or to preg_match the exact) character combinations like "E1PUZ" which lead to not sending the email? I know ... it is only a matter of time till the combinations are different but altering the php code once a month is not as much work as deleting all those failed delivery messages per day. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=309827.0 |