View Full Version : Update Form - For Users/Members etc

03-22-2010, 07:53 PM
Hi all

Im having a slight problem here, hopefully you can help

I have a Mysql database for members populated with username/password/email/country

What I want is a form that members can use once logged in so they can update/change the details of the database about themselves.

I have searched high and low for a simple guide but not found any luck. Anyone able to help here?

03-22-2010, 08:09 PM
Basicly all you need is a html form with the right input's for example if you have a section for country you would use a select box.

All you need to do is call the data out the database for the current user and set each value to the table row.

You may need to use stripslashes so it allows the data to show right, and on submit just check if each input value as been changed if it has then do a mysql update to update that users information.

03-22-2010, 10:16 PM
Just a quick note:

Read up on SQL injection and other malicious input attacks before opening up your database to editing. There is no "magic bullet" to prevent all database attacks and you also need to take into account other types of attacks, such as the possibility of a user inputting something as simple as malicious javascript inside of a block of text that they are submitting for their username or profile data. Such an attack could send cookie information and personal details of your users offsite for exploitation.

Anyway, security is an enormous issue with many facets but I just wanted to plant that seed in your mind as you begin. Always ALWAYS sanitize your users' input before processing it. Making it look nice in display should be a secondary objective.