posted 12 years ago
Hi Guys
I've started playing around with PHP and I'm busy writing a simple app which is backed by a MySQL database. I have a Users table in the database, and I want to create an HTML page which will allow you to add/edit/remove users. What is the standard way of doing this? What I have in mind for removing users goes something like this.
1.) User clicks the delete link
2.) Redirect the user's browser to a PHP script with the userID as a GET/POST parameter.
3.) The script deletes the user from the database.
4.) The script redirects the user to the previous page, which should now display one fewer user.
Does this sound sensible?
Also, how do you do validations? Do you validate all data on a form before redirecting to the next page, or do you send the values on your form to a seperate script for validations, which then redirects the user to the next page (if validation succeeds) or back to the previous page (if validation fails).
Thanks for your input.
Cheers,
Riaan
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." - George Bernard Shaw