close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

i think my contact form is leaking

Thread began 12/20/2010 8:22 pm by lk412779 | Last modified 12/22/2010 9:21 am by lk412779 | 1991 views | 8 replies |

lk412779

i think my contact form is leaking

Does the following validation look ok for the contact form portion from this page? i am still getting some spam in my database somehow and i cant figure out how.

Attached Files
contactpage_php.txt
Sign in to reply to this post

Ray BorduinWebAssist

This page looks secure to me, unless someone is manually spamming it. Are you sure it is from this page? Maybe add a page identifier with the insert to make sure you are looking at the page causing the issue.

When you try it, can you get it to insert without entering the correct security answers? I don't see any way someone could circumvent it, if it works for you. If it doesn't validate correctly with the wrong answers then I must be misssing something and let me know and I'll look more carefully for issues, but this looks secure to me.

Sign in to reply to this post
Did this help? Tips are appreciated...

lk412779

Thanks Ray, I do have one other page that has this contact form so i merged the code from the two pages to see if anything was different and here is the difference i found (sorry, i probably should have done this first)-

From page you reviewed:
if (isset($_POST["SimpleContact_submit"])) // Trigger

From the only other page that has what i thought was the exact same contact form code:

if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger

Could this be the problem? I cant figure out how i ended up with two different lines of code (*sigh).

Thanks again for helping

Sign in to reply to this post

Ray BorduinWebAssist

No that change shouldn't be enough to open a security hole. Can you get by the security on either page? Do both contain CAPTCHA and a security question?

Sign in to reply to this post
Did this help? Tips are appreciated...

lk412779

I have not been able to get by either of the page's protection and both have captcha and a question. Could it be this issue i've been trying to fix from the following thread?

showthread.php?t=17746

I'm going to add a page identifier tonight

Sign in to reply to this post

Ray BorduinWebAssist

No, that would explain if someone was adding information or editing the database but not email spam. Email spam would have to come from a page somewhere.

Sign in to reply to this post
Did this help? Tips are appreciated...

lk412779

Oops, i should have thought about the terms i was using. I'm not really getting "spam" emails, i am getting unwanted code, slashes and dots and other text added into three of my database tables that are linked to my simple contact form: Name, Email and Comments.
Me thinks this was the problem all along now.
When i say email above i mean where a visitor inputs his email into the contact form..

Sign in to reply to this post

Ray BorduinWebAssist

OK, well people are probably trying to hack the site through the form and are entering the correct captcha and security question answer.

The validation wouldn't prevent those fields from being entered. As it is applied now, it should prevent invalid email addresses, so that field having bad values is surprising. The comments and name fields don't have any specific validation on them.

So, are you asking how to prevent specific characters from being inserted into a field?

You can do that by changing the validation type.

So for instance if you changed:

$WAFV_Errors .= WAValidateRQ((isset($_POST["Contact_me_group_Name"])?$_POST["Contact_me_group_Name"]:"") . "",true,1);


to:

$WAFV_Errors .= WAValidateRT((isset($_POST["Contact_me_group_Name"])?$_POST["Contact_me_group_Name"]:"") . "","<, >",true,1);



Then added:

$WAFV_Errors .= WAValidateRT((isset($_POST[Contact_me_group_Comments"])?$_POST["Contact_me_group_Comments"]:"") . "","<, >",true,6);



Then you would have validation to prevent entering < or > into either the name or comments field.

Sign in to reply to this post
Did this help? Tips are appreciated...

lk412779

Thanks Ray, although i think you meant to add the same type of validation on that last bit of code there, I think this is exactly what i needed to know/do- Now i'm second guessing myself, was the email table full of the stuff too? Thanks- this should do it, if any thing comes up after this i'll let ya know. Thanks again for you help.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...