CONFUSED
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: CONFUSED
You have to query the database when the form is submitted. The form has an "action" attribut which points to a PHP file. That PHP file looks what username was requested then builds a SELECT query for the database:duffy wrote:in a form, how can you make it so that if someone puts in an invalid account (example to private message someone in a forum) it says: Sorry, This account is invalid.
Code: Select all
select id from users where username = '$username'All you have to do is check whether any rows are returned or not. If none are returned you redirect back to the form with something like form.php?error=no_such_user. You can use the header() function to do the redirect