Form related question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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.


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

Re: Form related question

<Wed, 28 Dec 2005 13:23:43 +0200>

Quoted text here. Click to load it

On the next page - just do a simple if ($qaz==$wsx) {print "username  
taken - click on back and try another username"; exit;}

If the username isnt taken it then it just carrys on with the rest of  
the page .

Site Timeline