allow users to update their own info in a MySQL db

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William Gill

    #1

    allow users to update their own info in a MySQL db

    I have a db of people in a group and want to allow individual group
    members a way to view and update their own contact information, but not
    anyone else's. I assume the safest/smartest way is via the php script
    checking the user/pwd of the form submitter to determine if the update
    query should be allowed (using a user permission given to the script,
    not the individual).

  • Erwin Moller

    #2
    Re: allow users to update their own info in a MySQL db


    William Gill schreef:
    I have a db of people in a group and want to allow individual group
    members a way to view and update their own contact information, but not
    anyone else's. I assume the safest/smartest way is via the php script
    checking the user/pwd of the form submitter to determine if the update
    query should be allowed (using a user permission given to the script,
    not the individual).
    >
    Hi,

    Without knowing the first thing about your setup, I'd say: yes.

    I always use sessions for this.
    User logs in: If username/password are correct, set $_SESSION["userid"]
    = ...
    The if they later on change their contactinfo:
    $SQL = "UPDATE .... WHERE (userid=".$_SES SION["userid"].");";

    Regards,
    Erwin Moller


    --
    =============== =============
    Erwin Moller
    Now dropping all postings from googlegroups.
    Why? http://improve-usenet.org/
    =============== =============

    Comment

    • William Gill

      #3
      Re: allow users to update their own info in a MySQL db

      Erwin Moller wrote:
      >
      >
      Without knowing the first thing about your setup, I'd say: yes.
      >
      I always use sessions for this.
      User logs in: If username/password are correct, set $_SESSION["userid"]
      = ...
      The if they later on change their contactinfo:
      $SQL = "UPDATE .... WHERE (userid=".$_SES SION["userid"].");";
      Thanks, that's what I thought, but I didn't to get midway into
      development and have to change my thinking.

      Comment

      Working...