SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how to verify user's session?

    Hi,
    Is there a way to check that the username entered into a form field is the same as the username registered in the session?

    thanks
    coiL
    "cradled in the learning curve"

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    London, UK.
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Firstly, might i suggest you search the forum for something that is simlar to your question. There have been plenty of questions that are pretty much the same as yours.

    This should work:

    PHP Code:
    <?

    if($_SESSION['username'] == $_POST['username_entered']) {

    echo 
    'Correct Username';
    } else {

    echo 
    'Not correct';

    }

    ?>
    Obviously you need to change the session name and post field name to represent your values.

    David
    Do you fear the obselescence of the
    metanarrative apparatus of legitimation?


Bookmarks

Posting Permissions

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