STOP; } function loginScreen ($msg='') { print << STOP; } function loginSuccess () { print << STOP; } function doLogin () { global $_REQUEST; $dologinscreen = 0; if ($_REQUEST['name'] == '') { loginScreen('Username left blank'); return; } $name = safe_mysql($_REQUEST['name']); if ($_REQUEST['pass'] == '') { loginScreen('Password left blank'); return; } $pass = safe_mysql($_REQUEST['pass']); $query = "select id,uname,banned,pword from users where uname like $name and pword=$pass"; ($res = mysql_query($query)) or die(mysql_error()); if ($res) { if (mysql_num_rows($res) == 1) { $row = mysql_fetch_row($res); $_SESSION['uid'] = $row[0]; $_SESSION['uname'] = $row[1]; $_SESSION['banned'] = $row[2]; loginSuccess(); } else { $dologinscreen = 1; } mysql_free_result($res); } else { print "\n"; } if ($dologinscreen==1) { loginScreen('Invalid login info'); } } function createScreen ($msg='') { print << STOP; } function createSuccess () { print << STOP; } function doCreate () { global $_REQUEST; if ($_REQUEST['name'] == '') { createScreen('User name left blank.'); return; } if ($_REQUEST['pass1'] == '') { createScreen('Password left blank.'); return; } if ($_REQUEST['pass2'] == '') { createScreen('Verify Password left blank.'); return; } if ($_REQUEST['email'] == '') { createScreen('Email address left blank.'); return; } if ($_REQUEST['pass1'] != $_REQUEST['pass2']) { createScreen('Passwords do not match.'); return; } $name = safe_mysql($_REQUEST['name']); $pass = safe_mysql($_REQUEST['pass1']); $email = safe_mysql($_REQUEST['email']); $query = "select count(*) from users where email=$email"; $res = mysql_query($query); $row = mysql_fetch_row($res); $exists = $row[0]; if ($exists > 0) { createScreen('That email address already has an account here.'); return; } $query = "select count(*) from users where uname=$name"; $res = mysql_query($query); $row = mysql_fetch_row($res); $exists = $row[0]; if ($exists > 0) { createScreen('That username is already taken.'); return; } $query = "insert into users (uname,pword,email,added) values ($name,$pass,$email,now())"; mysql_query($query); $query = "select id,uname,banned from users where uname=$name and pword=$pass"; $res = mysql_query($query); $row = mysql_fetch_row($res); $_SESSION['uid'] = $row[0]; $_SESSION['uname'] = $row[1]; $_SESSION['banned'] = $row[2]; createSuccess(); } include('inc/startup.php'); $action = ''; if (array_key_exists('action', $_REQUEST)) { $action = $_REQUEST['action']; } if ($action == 'login') { doLogin(); } elseif ($action == 'create') { doCreate(); } else { loginCreateScreen(); } include('inc/finish.php'); ?>
 
  Legend of the Red Dragon - Login
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Why create a user account?

  • You must login to be able to "Converse with the patrons"
  • Once I can get the gumption to do so, the message board will be tied to this login
  • Eventually, IGM authors will be able to login and modify/update/whatever their own files
  • To post on "Uber's Wishlist" you must be logged in
  • Eventually, there will be a community news page, and you'll need to be logged in to post your own news

    Worried about how your email address is used? Your email address is not shared with anyone. It is used for one purpose only: If you lose your login info, your login info will be emailed to the address you registered with.


  • Have a user account? Login here
    Username
    Password

    Need a user account? Create one here
    Username
    Password
    Verify Password
    Email Address

    (Q)uit to Main

    $msg


    Username
    Password

    You have successfully logged in.

    (R)eturn to Main
    Sorry, can't hit the database. Please try again later.
    $msg
    Username
    Password
    Verify Password
    Email Address

    Success! Your acount has been created and you have been logged in.

    (R)eturn to Main
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-