Advertisement
Guest User

Untitled

a guest
May 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. <?php
  2.  
  3. //log into the database
  4. $dbhost = 'localhost';
  5. $dbuser = 'blooding_Admin';
  6. $dbpass = '7thuchiha';
  7.  
  8. $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
  9.  
  10. $dbname = 'blooding_mainSQL';
  11. mysql_select_db($dbname);
  12.  
  13. if (isset($_COOKIE["member_id"])) {
  14. if ($_COOKIE["member_id"] == 0) {
  15.  
  16. echo "<form action='/forums/index.php?act=Login&CODE=01' method='post' name='LOGIN'>
  17. <strong>Username</strong>: <input type='text' size='25' maxlength='64' name='UserName' /><br />
  18. <strong>Password</strong>: <input type='password' size='25' name='PassWord' /><br />
  19. Remember Me? <input class='checkbox' type='checkbox' name='CookieDate' value='1' checked='checked' /><br />
  20. <input class='button' type='submit' name='submit' value='Log In' /><a href='/forums/index.php?act=Reg'>Register</a>
  21. </form>";
  22. }
  23. else { // Content that shows up if logged in
  24. // get the persons username from the database
  25. $query = mysql_query("SELECT `members_display_name`,`id` FROM `ibf_members` WHERE `id`=" . mysql_real_escape_string($_COOKIE['member_id']) . " LIMIT 1");
  26.  
  27. //then you need to get the result into an array
  28. $result = mysql_fetch_assoc($query);
  29.  
  30. //show the username
  31. echo "Welcome Back, {$result['members_display_name']}!<br />
  32. <a href='/forums/index.php?showuser={$result['id']}'>[View Profile]</a>-<a href='/forums/index.php'>[Log Out]</a>";
  33. }
  34. }
  35. else {
  36.  
  37. echo "<form action='/forums/index.php?act=Login&CODE=01' method='post' name='LOGIN' target='_top'>
  38. <strong>Username</strong>: <input type='text' size='25' maxlength='64' name='UserName' /><br />
  39. <strong>Password</strong>: <input type='password' size='25' name='PassWord' /><br />
  40. Remember Me? <input class='checkbox' type='checkbox' name='CookieDate' value='1' checked='checked' /><br />
  41. <input class='button' type='submit' name='submit' value='Log In' /><a href='/forums/index.php?act=Reg'>Register</a>
  42. </form>";
  43. }
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement