Jump to content

nonamenoob

New Members
  • Posts

    3
  • Joined

  • Last visited

nonamenoob's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i figured out the problem, and that this website is tiny and doesnt need a 'advanced' login system, the problem started at daylight savings, and my computer for whatever reason wasnt set for it, and so the cookies expired as they were created, thanks for all your help tho
  2. i mean i cant login from any other computer, i can only from the computer its hosted on.
  3. my login system is awesome, i added one small thing and BAM it broke, i cant see the problem but i hope to have it fixed here, here is my code for my login page <?PHP include_once("sql.php"); if (isset($_POST["user"])) { if (isset($_POST["pass"])) { if ($_POST["user"] == "") { login("u"); } else { $loggedIn = false; $result = mysql_query("select * from users;"); while($row = mysql_fetch_assoc($result)) { if ($_POST["user"] == $row["user"]) { if ($_POST["pass"] == $row["password"]) { $loggedIn = true; setCookie("user",$row["user"], time()+3600); setCookie("password",$row["password"],time()+3600); setCookie("team",$row["team"], time()+3600); \\ added this (a new colium in the table) break; } } } if ($loggedIn) { print " <a href=\"index.php\">Login</a> "; } else { login("up"); } } } else { if ($_POST["user"] == "") { login("up"); } else { login("p"); } } } else { login(""); } function login($error) { $user = ""; $pass = ""; if ($error == "u") { $user = "<br />Username is incorrect"; } if ($error == "p") { $pass = "<br />Password is incorrect"; } if ($error == "up") { $user = "<br />Username not used"; $pass = "<br />Password is incorrect"; } // form here just simple "username" and "password" fields } ?> note: my website is only small thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.