Form Validation Script help

1 replies
  • WEB DESIGN
  • |
I have written a validation script that has sessions in the header file to keep data in the fields if there is any incorrect info in the form. The issue that I am having is upon successful submission the form will first post a blank entry in the database, then one with all of the info, and then another blank one. I have looked through the code multiple times and am not sure what is causing the issue.

It also appears that when validation fails, the form still submits a set of blank info into the database.

[PHP] if then - Pastebin.com

Could someone please point me in the right direction?
#form #script #validation
  • Profile picture of the author otfromtot
    the problem was solved by changing line 6 from if (count($post_contents) <= 0) to if (count($_POST) <= 0)
    {{ DiscussionBoard.errors[8169872].message }}

Trending Topics