Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4

Thread: Help (:

  1. #1
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default Help (:

    <html><head><link href="logintheme/style.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    .style1 {
    font-family: "Trebuchet MS";
    font-size: 30pt;
    }
    .style2 {
    text-align: center;
    }
    .style3 {
    color: #FF0000;
    }
    </style>
    </head><body background="logintheme/HabboForestBG.gif" bgcolor="#d0e9ee">




    <br><br>
    <div align="center">
    <table border="0" cellpadding="0" cellspacing="0" height="103" width="454">
    <tbody><tr>
    <td width="12">
    <img src="logintheme/topleft.gif" height="12" width="12"></td>
    <td background="logintheme/top.gif" width="496"></td>
    <td width="12">
    <img src="logintheme/topright.gif" height="12" width="12"></td>
    </tr>
    <tr>

    <td background="logintheme/left.gif" width="12"></td>
    <td background="logintheme/background.png" height="100" width="496">
    <p>
    </p><table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tbody><tr><td width="652">
    <div class="style2">
    <span class="style1"><strong>staff<span class="style3">panel</span></strong></span><br>
    <br>
    Welcome
    to the HabboMedia DJ Panel, here is where our radio staff may login to manage
    the radio and read request's, you require authentication to get past this
    login stage, if your not staff you are forbidden from logging in.<br><?php

    session_start();

    $host = "localhost";

    $user = "Removed";

    $pass = "Removed";

    $db = "Removed";

    $ms = mysql_connect($host, $user, $pass);

    if(!$ms) { echo "Error connecting to database.\n"; }

    mysql_select_db($db);


    if($_GET['action'] == "login") {

    $user_post = addslashes($_POST["username_post"]);

    $pass_post = addslashes($_POST["password_post"]);

    $check = mysql_fetch_object(mysql_query("SELECT * FROM `staff` WHERE `username` = '" . $user_post . "' ;"));

    if($pass_post != $check->password){
    die("<br />Error: Your password was incorrect.");
    }elseif(empty($user_post) OR empty($pass_post)){
    die("<br />Error: Please fill in all form fields.");
    }

    $_SESSION['session_username'] = $check->username;

    $_SESSION['session_level'] = $check->level;

    $_SESSION['session_ip'] = $_SERVER['REMOTE_ADDR'];



    echo "<font color=green><b><br>Valid:<br></b></font>&nbsp;Please wait, redirecting.<meta http-equiv=\"refresh\" content=\"0;url=manage.php\"><br><img src='http://www.habbomedia.net/panel-files/bottom_login.gif'>";

    exit;

    ?>
    <?php } ?>

    </div>
    <p></p><center><form action="?action=login" method="post">
    <center><font color="#000000" face="Verdana" size="1"><b><br>
    User<span class="style3">name:</span></b><br>
    <input name="username_post" size="25"></font><br><br>

    <font color="#000000" face="Verdana" size="1">
    <strong><span class="style3">
    Pass</span>word<span class="style3">:</span></strong><br><input name="password_post" size="25" type="password"></font><p align="center"><input value=" Login " type="submit">

    <br>
    </p></center></form></center></td></tr>
    </tbody></table>
    </td>
    <td background="logintheme/right.gif" width="12"></td>
    </tr>
    <tr>
    <td width="12">
    <img src="logintheme/bottomleft.gif" height="12" width="12"></td>
    <td background="logintheme/bottom.gif" width="496"></td>
    <td width="12">
    <img src="logintheme/bottomright.gif" height="12" width="12"></td>
    </tr>
    </tbody></table>







    </div></body></html>
    I have to login twice, how can I make it once? It's something wrong with the code, I used to get this error when I used to use phpDJ if I edited the code, and on housekeeping if I edited the code too.
    Last edited by Independent; 21-02-2008 at 07:38 AM.

  2. #2
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default

    well theres html before the <php?

    maybe..

    <?php

    session_start();

    $host = "localhost";

    $user = "Removed";

    $pass = "Removed";

    $db = "Removed";

    $ms = mysql_connect($host, $user, $pass);

    if(!$ms) { echo "Error connecting to database.\n"; }

    mysql_select_db($db);


    if($_GET['action'] == "login") {

    $user_post = addslashes($_POST["username_post"]);

    $pass_post = addslashes($_POST["password_post"]);

    $check = mysql_fetch_object(mysql_query("SELECT * FROM `staff` WHERE `username` = '" . $user_post . "' ;"));

    if($pass_post != $check->password){
    die("<br />Error: Your password was incorrect.");
    }elseif(empty($user_post) OR empty($pass_post)){
    die("<br />Error: Please fill in all form fields.");
    }

    $_SESSION['session_username'] = $check->username;

    $_SESSION['session_level'] = $check->level;

    $_SESSION['session_ip'] = $_SERVER['REMOTE_ADDR'];



    echo "<font color=green><b><br>Valid:<br></b></font>&nbsp;Please wait, redirecting.<meta http-equiv=\"refresh\" content=\"0;url=manage.php\"><br><img src='http://www.habbomedia.net/panel-files/bottom_login.gif'>";

    exit;

    ?> <html><head><link href="logintheme/style.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    .style1 {
    font-family: "Trebuchet MS";
    font-size: 30pt;
    }
    .style2 {
    text-align: center;
    }
    .style3 {
    color: #FF0000;
    }
    </style>
    </head><body background="logintheme/HabboForestBG.gif" bgcolor="#d0e9ee">




    <br><br>
    <div align="center">
    <table border="0" cellpadding="0" cellspacing="0" height="103" width="454">
    <tbody><tr>
    <td width="12">
    <img src="logintheme/topleft.gif" height="12" width="12"></td>
    <td background="logintheme/top.gif" width="496"></td>
    <td width="12">
    <img src="logintheme/topright.gif" height="12" width="12"></td>
    </tr>
    <tr>

    <td background="logintheme/left.gif" width="12"></td>
    <td background="logintheme/background.png" height="100" width="496">
    <p>
    </p><table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tbody><tr><td width="652">
    <div class="style2">
    <span class="style1"><strong>staff<span class="style3">panel</span></strong></span><br>
    <br>
    Welcome
    to the HabboMedia DJ Panel, here is where our radio staff may login to manage
    the radio and read request's, you require authentication to get past this
    login stage, if your not staff you are forbidden from logging in.<br>
    <?php } ?>

    </div>
    <p></p><center><form action="?action=login" method="post">
    <center><font color="#000000" face="Verdana" size="1"><b><br>
    User<span class="style3">name:</span></b><br>
    <input name="username_post" size="25"></font><br><br>

    <font color="#000000" face="Verdana" size="1">
    <strong><span class="style3">
    Pass</span>word<span class="style3">:</span></strong><br><input name="password_post" size="25" type="password"></font><p align="center"><input value=" Login " type="submit">

    <br>
    </p></center></form></center></td></tr>
    </tbody></table>
    </td>
    <td background="logintheme/right.gif" width="12"></td>
    </tr>
    <tr>
    <td width="12">
    <img src="logintheme/bottomleft.gif" height="12" width="12"></td>
    <td background="logintheme/bottom.gif" width="496"></td>
    <td width="12">
    <img src="logintheme/bottomright.gif" height="12" width="12"></td>
    </tr>
    </tbody></table>







    </div></body></html>
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

  3. #3
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Even if I put it at the top, before the html it would do the same, plus I tried that

  4. #4
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default

    Uhhm.. did u make the djpanel or r u just editing one?

    EDIT~

    Okay check manage if its picking up the session right?
    <meta http-equiv=\"refresh\" content=\"0;url=manage.php\">
    Last edited by chrisgocrazyH; 21-02-2008 at 09:59 AM.
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •