Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flooding textfields/textareas.

Status
Not open for further replies.

mcode12

Programmer
Aug 8, 2007
25
GB
Hello,

anyone know where's there any articles on how to stop people flooding your database with records through an textfield or textarea?

thanks.
 
ok thanks.
Do you know any articles that could help me understand exactly what is happening?
Do they do it by simply clicking the submit button again and again?

 
I'm not exactly sure of the question.

Do you want to limit the amount of text submitted in each transaction? Suppose you want only 1000 characters per submission... you could reduce the field size in the actual database table and then add some server-side ASP to truncate the text before inserting it into the database, perhaps with the Left() function.


Has someone written a program to automatically submit over and over and over until your database is full? If so then perhaps some sort of CAPTCHA is the answer. See:

Do your users need to be logged into your system before they submit the data? Perhaps you should not take anonymous submissions? If you know WHO is submitting the data then you can limit the number of submissions per username per day/week/month.

If none of these describe your situation then please clarify the question.
 
I take it they are spamming the text field.

Pain in the butt when they do that.

i put a text box with a random question in it, like Are you Human.
If they answer it yes then fine submit everything, but if they fail to answer then it is a bot and you dont submit it.

}...the bane of my life!
 
I was thinking more in the line of someone submitting continuously by clicking the submit button.
Could you just create a session that lasts for a minute or a set period that blocks then from resubmitting. Would that be one way to do it?



 
yes but that would mean someone could fill in the text field and just manually start clicking the submit button as many times as they wish..
 
One option would be to store the time in a session variable on a successful post. Each time the form is submitted you would first check if that session variable has a value and then if that time is more than a certain number of seconds or minutes from the current time (basically a DateDiff between the session variable and Now).

Another option that I use occasionally when we have people re0submitting entries (accidentally or on purpose) is to do a SELECT from the database ahead of time to see fit he content has already been submitted once. If it has, I output an error to that effect, otherwise I continue with the submit.

-T

Best MS KB Ever:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top