Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Receiving blank form submissions
Old 03-06-2010, 09:38 PM Receiving blank form submissions
crly's Avatar
Novice Talker

Posts: 7
Name: Carly
Location: Brisbane, Australia
Trades: 0
Hi, I'm currently receiving blank form submissions and am not sure what steps to take to stop this. Any suggestions are much appreciated.

I've set up a HTML form where the compulsory fields are checked using javascript, using <form onSubmit="return myVerificationFunction" etc...

The form is at: http://www.taewynpublishing.com.au/orderform.html

Just for a bit of context, after it's verified the data is posted to a perl cgi script that collects the data, then sends that data in an email to me, but also presents another form for the client to confirm their details before moving to the bank hosted payment page for credit card details etc.

My problem seems to be that the initial html form verification works for humans, but I'm still receiving blank forms in my email.

I don't know much about robots and spammers, so is captcha something I should look into, or am I missing something?

Thanks for your help.

Last edited by crly; 03-06-2010 at 10:29 PM.. Reason: Forgot to add link to form
crly is offline
Reply With Quote
View Public Profile Visit crly's homepage!
 
 
Register now for full access!
Old 03-07-2010, 04:25 AM Re: Receiving blank form submissions
MattGoucher's Avatar
Skilled Talker

Posts: 64
Name: Matt
Location: California
Trades: 0
I hopped on over to your website and checked out the form. The simple JavaScript form validation works fine if the user enters values or doesn't. However, when the user enters a number of spaces, eg(" ") then the value counts as legitimate.

I hope knowing this helps a bit.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Invalid Code On A New Website Is Like Having A New Car With A Broken Windshield
MattGoucher is offline
Reply With Quote
View Public Profile Visit MattGoucher's homepage!
 
Old 03-09-2010, 03:34 AM Re: Receiving blank form submissions
crly's Avatar
Novice Talker

Posts: 7
Name: Carly
Location: Brisbane, Australia
Trades: 0
Yes, thanks Matt. Looks like that's what was getting through. Have added checks for spaces in my validation script. Thanks heaps!
crly is offline
Reply With Quote
View Public Profile Visit crly's homepage!
 
Old 03-10-2010, 01:30 AM Re: Receiving blank form submissions
MattGoucher's Avatar
Skilled Talker

Posts: 64
Name: Matt
Location: California
Trades: 0
Glad I could help
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Invalid Code On A New Website Is Like Having A New Car With A Broken Windshield
MattGoucher is offline
Reply With Quote
View Public Profile Visit MattGoucher's homepage!
 
Old 03-10-2010, 01:40 AM Re: Receiving blank form submissions
ThailandForum's Avatar
King Spam Talker

Posts: 1,415
Name: Sir Richard Cranium
Location: Bangkok Thailand
Trades: 0
People trying mysql injections perhaps?
__________________

ThailandForum is offline
Reply With Quote
View Public Profile Visit ThailandForum's homepage!
 
Old 03-30-2010, 05:47 AM Re: Receiving blank form submissions
crly's Avatar
Novice Talker

Posts: 7
Name: Carly
Location: Brisbane, Australia
Trades: 0
Hi, sorry to reopen this, but even with my space checking, blank form submissions are still getting through.

Is there anything else I should be checking for? I don't understand what mysql injections are, how can I screen for those?

My validation script is at:
http://www.taewynpublishing.com.au/s...lidate_form.js

or below:

Code:
var msg = "";
var err = 0;
var checkSpace = new RegExp(/^[\s]*$/);
var numericExpression = new RegExp(/^[0-9]*$/);
function verify() {
 // Check name field
 var namestr = document.orderform.contactname.value;
 if (( namestr == "" ) || ( checkSpace.test(namestr) )) {
  msg += "Please provide your name.\n";
  err += 1;
 }
 
 // Check address field
 var addressstr = document.orderform.address.value;
 if (( addressstr == "" ) || ( checkSpace.test(addressstr) )) {
  msg += "Please provide your delivery address.\n";
  err += 1;
 }
 
 // Check email field
 var emailstr = document.orderform.email.value;
 if (( emailstr == "" ) || ( checkSpace.test(emailstr) )) {
  msg += "Please provide your email address.\n";
  err += 1;
 }
 
 // Check no. books is a number and then if only 1 or 2
 if ( document.orderform.nobooks.value.match(numericExpression) ) {
  if (( document.orderform.nobooks.value > 2 ) || ( document.orderform.nobooks.value < 1 )) {
   msg += "You may only order 1 to 2 books online.\n";
   err += 1;
  }
 }
 else {
  msg += "Please specify no. books.\n";
  err += 1;
 }
 
 // Check support radio buttons
 var btn = -1;
 var i;
 for ( i = document.orderform.support.length - 1; i > -1; i-- ) {
  if ( document.orderform.support[i].checked ) {
   btn = i; 
   i = -1;
  }
 }
 if ( btn == -1 ) {
  msg += "Please specify the organisation you wish to support.\n";
  err += 1;
 }
 // Sum it all up and display message if needed
 if (err > 0) {
  alert(msg);
  msg = ""; // Clear msg
  err = 0; // Reset error count
  return false;
 }
 else {
  return true;
 }
}
Thanks for your help.
crly is offline
Reply With Quote
View Public Profile Visit crly's homepage!
 
Old 03-30-2010, 07:58 AM Re: Receiving blank form submissions
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Bots don't run javascripts so your "validation" will never run for such "submssions".

Use server side code to determine if the form is blank.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Receiving blank form submissions
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54575 seconds with 12 queries