SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member moneybyus's Avatar
    Join Date
    Mar 2001
    Location
    MN
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    session register help

    Can someone please tell me why $user wont get registered?

    here is my code.

    session_register("username");
    session_register("pwd");

    dbConnect("moneybyus_com");
    $sql = "SELECT * FROM users WHERE userid = '$username' AND password = '$pwd'";
    $result = mysql_query($sql);
    if (!$result) {
    error("A database error occurred while checking your ".
    "login details.\\nIf this error persists, please ".
    "contact support@moneybyus.com.");
    }

    if (mysql_num_rows($result) == 0) {
    session_unregister("username");
    session_unregister("pwd");

    error("Your username and/or password are invalid.\\n".
    "Please go back and try again.");
    }


    $sql = mysql_query("SELECT id FROM users WHERE userid = '$username'");
    $array = mysql_fetch_array($sql);
    $user = $array[id];
    session_register("$user");

  2. #2
    SitePoint Member moneybyus's Avatar
    Join Date
    Mar 2001
    Location
    MN
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just wanted to say that is just part of the code.


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
  •