Hello and welcome to our community! Is this your first visit?
Register
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
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Please help with $_SESSION

    Hey guys, could you help me please with $_SESSION as I'm trying to create admin login page. Here's the code:

    <?php
    session_start();
    $_SESSION['user']="username";
    ?>
    (Then I enter adminindex.php which checks if "username" is admin or not from MySQL table).

    What I want to do is to make it as a form, so I wouldn't need to go to the actual code to change the "username" and that it would transfer me to adminindex.php (where it checks if "username" is an admin or not).

    Thank s in advance!
    Last edited by Staidas; 04-21-2012 at 11:59 AM. Reason: Grammar

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,417
    Thanks
    68
    Thanked 102 Times in 101 Posts
    Are you saying you want to alter the current session? I hope not.

    If you mean someone enters their username and password and it creates a session, and it creates a new session for their username, that's different.
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #3
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure what is the difference as I'm new at it... I'm just looking into different ways to login to admin panel. I was hoping that it is possible to change the "username" in other way then thru code editing.


  •  

    Tags for this Thread

    Posting Permissions

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