PDA

View Full Version : Help (:



Independent
21-02-2008, 07:36 AM
<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.

chrisgocrazyH
21-02-2008, 08:54 AM
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>

Independent
21-02-2008, 09:29 AM
Even if I put it at the top, before the html it would do the same, plus I tried that

chrisgocrazyH
21-02-2008, 09:58 AM
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\">

Want to hide these adverts? Register an account for free!