Advanced PHP/MySQL User Membership Script

sletts02sletts02 BeginnerLink Clerk
How would I go about making it so members can edit their profile once logged in?

Comments

  • PythonPython Forum Leader The Royal RAM
    You would need a page for example called profile.php

    Firstly it would check if the user is logged in and if yes it would show the appropiate form fields

    When submitted the form would update the database with the new information

    The Royal Ram

  • sletts02sletts02 Beginner Link Clerk
    Could you please provide a code example as I am not that good with PHP / mySQL.
  • $cripts$cripts Beginner Link Clerk
    you would first need to have a session setup with either cookies or a browser end session il show u with cookies :)
    saying that you have the following cookies
    user_id
    [php]
    <?
    session_start();
    include(class.php);
    include(config.php);
    $user_id = $_COOKIE;
    ###DETERMAIN IF USER IS LOGGED IN
    $checkuser = $db->query("select user_id from ".$db_prefix."_users where user_id='$user_id'");
    $count = $db->count($checkuser);
    if($count == 1)
    {
    Your content for profile update!
    }
    else
    {
    Error Message
    }
    ##SAVE USER INFO
    if(!$_POST
    {
    echo "What are you doing?"
    }
    else
    {
    $update = $db->query("update ".$db_prefix."_users set username='$username'");
    }
    ?>
    [/php]

    thats pretty much how it goes i used a mysql class and a wut not but its really simple
Sign In or Register to comment.