DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Validating input from a form against a database

  1. #1
    Geoffrey Guest

    Validating input from a form against a database


    How can I 1) check if the input from a form matches the data in my database
    2) and perform a conditional function 3) which sets a cookie if they match
    or 4) an error message if it doesn't match?

  2. #2
    Q*bert Guest

    Re: Validating input from a form against a database


    I'll assume that your using ASP or some equivelent.

    From the form submit to a server side form that serves no purpose but to
    do what you described.

    1) Makes queries to the database to find/ensure data matches (Not sure why
    your doing this) if the data is to match what's in the database why not use
    drop downs...)
    2) Provided that some conditions are met peform a function(IF statement)
    3) Within the If statement, set cookie
    4) Else response.write("Error Message")

    Now if your wanting to do all this client side...
    1) Pass available db info to hidden controls
    2) validate the data using javascript
    3) set your cookie... (I'm not sure how to do that w/ Javascript)
    4) else use an alert to display error message.

    Now if your not using ASP or javascript... I'm not sure how to help

    "Geoffrey" <Geoffrey@thinkcanvas.co> wrote:
    >
    >How can I 1) check if the input from a form matches the data in my database
    >2) and perform a conditional function 3) which sets a cookie if they match
    >or 4) an error message if it doesn't match?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center