Thank you for that small hack, that DID finally get rid of it in its entirety. I am not very sure how much help this will be, though I believe it will help a little bit..I decided to throw these regexes on all the form fields.. For the name, address1, address2, city, country I removed the colon (:) and removed the words TO, FROM, SUBJECT. If the user tries to write those in, it's removed before it saves to my database.
For the email address, I applied the same regexes but I also applied the join [ ,] thing you mentioned earlier. The ZIP code is also using this join feature, that way anything after the first comma or space is removed and not worried about.
After running a few tests, it seems to be working fine. The user can still add fake data to the fields, but the harmful codes have been removed and all that's left is text. That's no big deal :).
Thanks for all your help everyone!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.