Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //log into the database
- $dbhost = 'localhost';
- $dbuser = 'blooding_Admin';
- $dbpass = '7thuchiha';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
- $dbname = 'blooding_mainSQL';
- mysql_select_db($dbname);
- if (isset($_COOKIE["member_id"])) {
- if ($_COOKIE["member_id"] == 0) {
- echo "<form action='/forums/index.php?act=Login&CODE=01' method='post' name='LOGIN'>
- <strong>Username</strong>: <input type='text' size='25' maxlength='64' name='UserName' /><br />
- <strong>Password</strong>: <input type='password' size='25' name='PassWord' /><br />
- Remember Me? <input class='checkbox' type='checkbox' name='CookieDate' value='1' checked='checked' /><br />
- <input class='button' type='submit' name='submit' value='Log In' /><a href='/forums/index.php?act=Reg'>Register</a>
- </form>";
- }
- else { // Content that shows up if logged in
- // get the persons username from the database
- $query = mysql_query("SELECT `members_display_name`,`id` FROM `ibf_members` WHERE `id`=" . mysql_real_escape_string($_COOKIE['member_id']) . " LIMIT 1");
- //then you need to get the result into an array
- $result = mysql_fetch_assoc($query);
- //show the username
- echo "Welcome Back, {$result['members_display_name']}!<br />
- <a href='/forums/index.php?showuser={$result['id']}'>[View Profile]</a>-<a href='/forums/index.php'>[Log Out]</a>";
- }
- }
- else {
- echo "<form action='/forums/index.php?act=Login&CODE=01' method='post' name='LOGIN' target='_top'>
- <strong>Username</strong>: <input type='text' size='25' maxlength='64' name='UserName' /><br />
- <strong>Password</strong>: <input type='password' size='25' name='PassWord' /><br />
- Remember Me? <input class='checkbox' type='checkbox' name='CookieDate' value='1' checked='checked' /><br />
- <input class='button' type='submit' name='submit' value='Log In' /><a href='/forums/index.php?act=Reg'>Register</a>
- </form>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement