Form related question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wayne

    Form related question

    Hi,

    I am looking at adding a form to my site allowing visitors to
    subscribe with a username. The form should ideally first check
    to see if the username has been taken (From text file or MYSQL database)
    and then submit the form to my email address. If the username is taken it
    should return a message to the user advising them of this.

    Can anyone perhaps assist with this or direct me to a tutorial for the
    checking of the username part? The rest of the form is working.

    --
    Wayne


  • Shelly

    #2
    Re: Form related question

    In your submit processing area do a select from the database. If there
    is a match you could do one of two things:

    Set a session variable with an error message and call the page again.

    or call the page again with the error message as the parameter.

    In either case you would display the message in the form area. In the
    first method you would then unset the variable. In the second method
    you would set a vaiable near the beginning of the code using $_GET and
    it would be this variable you would later display.

    On success you would go somewhere else. The calling would be don with
    header()

    Comment

    Working...