Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Thanked 0 Times in 0 Posts

    Update Form - For Users/Members etc

    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?

  • #2
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    United Kindom
    Thanked 136 Times in 136 Posts
    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.

  • #3
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Some say it's everything.
    Thanked 397 Times in 390 Posts
    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.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts