PDA

View Full Version : Ourhabbo Usersystem



chrisgocrazyH
18-01-2008, 07:23 AM
Hello i've Install ourhabbos usersystem In login.php i get this error:

Parse error: syntax error, unexpected $end in /home/******/public_html/*********/system/login.php on line 170

login.php code?


<?
ob_start();
// allows you to use cookies.
include("config.php");
if (!$logged[username])
{
if (!$_POST[login])
{
echo("
<center><form method=\"POST\">
<table>
<tr>
<td align=\"center\">
Username: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\">
</td>
</tr>
<tr>
<td align=\"center\">
Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"password\">
</td></tr><tr>
<td align=\"center\">
<input type=\"submit\" name=\"login\" value=\"Login\">
</td></tr><tr>
<td align=\"center\">
<a href=\"register.php\" target=\"middle\">Register Here</a>
</td>
</tr></table></form></center>");
}
if ($_POST[login]) {
// the form has been submitted. We continue...
$username=$_POST['username'];
$password = md5($_POST[password]);
// the above lines set variables with the submitted information.
$info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);
if($data[password] != $password) {
// the password was not the user's password!
echo "<meta http-equiv=\"Refresh\" content=\"2; URL=login.php\"/><center>Incorrect username or password!<br><br>Please Wait</center>";
}else{
// the password was right!
$profile = mysql_query("SELECT * FROM users WHERE username = '$logged[username]'") or die(mysql_error());
$query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);
$date = date("j F G : i");
if($user[level] == 11){
mysql_query("INSERT INTO `modlogins` (`id` , `description` ) VALUES (NULL , '$user[username] :::: $date')");
}
// gets the user's information
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
mysql_query("INSERT INTO `logins` (`id`, `username` , `description` ) VALUES (NULL , '$user[username]' , '$date')");
// the above lines set 2 cookies. 1 with the user's id and another with his/her password.
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=login.php\"/><center>Thank You! You will be redirected</center>");
// modify the above line...add in your site url instead of yoursite.com
}
}
else
{
$profile = mysql_query("SELECT * FROM users WHERE username = '$logged[username]'") or die(mysql_error());
$new = mysql_query("select * from pmessages where unread = 'unread' and touser = '$logged[username]'");
$new = mysql_num_rows($new);
$pms = mysql_query("select * from pmessages where touser = '$logged[username]'");
$pms = mysql_num_rows($pms);
$rquery = mysql_query("SELECT * FROM cfh"); # Queries The Call For Help Messages
while($m=mysql_fetch_array($rquery)) # Displays Them All In Order
// we now display the user controls.
if($logged[username] && $logged[level] == 0 ){
echo "<p>Sorry, you are banned. And therefore cannot view this page!</p><p>To have the ban lifted, email [email protected] and we will look into the case.</p>";
}
if($logged[username] && $logged[level] >= 1)
{
echo ("<p>Welcome <span class='$logged[level]'><b>$logged[username]</b></span>!<br>
- <a href=\"select_badge.php\" target=\"middle\">Set Display Badge</a><br />
- <a href=\"messages.php\" target=\"middle\">Message Center</a> ");
include("new.php");
echo("<br />
- <a href=\"members.php\" target=\"middle\">Members List</a><br />
- <a href=\"values_1.php\" target=\"middle\">Rare Values</a><br />
- <a href=\"badges.php\" target=\"middle\">Badges List</a><br />
- <a href=\"rooms.php\" target=\"middle\">Chatrooms</a><br />
- <a href=\"contact.php\" target=\"middle\">Help Tool</a><br />
- <a href=\"logout.php\" target=\"login\">Logout</a><br /> ");
if($logged[username] && $logged[level] == 12)
echo "- <a href=\"admin/index.php\" target=\"middle\">Admin Panel</a><br/>";
if($logged[username] && $logged[level] == 11 || $logged[level] == 12)
echo "- <a href=\"mod/index.php\" target=\"middle\">Mod Panel</a><br />";
if($logged[username] && $logged[level] == 9 || $logged[level] == 12)
echo "- <a href=\"managers/index.php\" target=\"middle\">Managers Panel</a><br />";
if($logged[username] && $logged[level] == 10 || $logged[level] == 12)
echo "- <a href=\"support/index.php\" target=\"middle\">Player Support</a><br />";
}
}
?>
<html>
<head>
<title>Home</title>
<style type="text/css">
a {
font-size: 10px;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body,td,th,p {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
.12 { color: red; }
.11 { color: navy; }
.10 { color: ; }
.9 { color: darkorchid; }
.8 { color: darkorchid; }
.7 { color: darkorchid; }
.6 { color: darkorchid; }
.5 { color: green; }
.4 { color: green; }
.3 { color: green; }
.2 { color: green; }
.1 { color: black; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
width: 100;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
select {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 100;
border: 1px solid #000000;
}
textarea {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 100;
border: 1px solid #000000;
}

</style>
<meta http-equiv=\"Refresh\" content=\"30; URL=login.php\"/>
</head>
<body bgcolor="transparent">
</body>
</html>
<?
if ($logged[banned] == 'banned'){
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=banned.php\"/>");
?>
I NEED THIS BEFORE TONIGHT! Please HELP PLEASE!! I WILL +REP x3

Moved by Agesilaus (Forum Super Moderator) from Designing and Development: Please post in the correct forum next time.

RedCrisps
18-01-2008, 08:31 AM
get that other usersystem that habbo-center made

chrisgocrazyH
18-01-2008, 08:47 AM
But its not really editable like i cant make the PM system look like a console?

Hitman
18-01-2008, 01:19 PM
Try this.


<?
ob_start();
// allows you to use cookies.
include("config.php");
if (!$logged[username])
{
if (!$_POST[login])
{
echo("
<center><form method=\"POST\">
<table>
<tr>
<td align=\"center\">
Username: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\">
</td>
</tr>
<tr>
<td align=\"center\">
Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"password\">
</td></tr><tr>
<td align=\"center\">
<input type=\"submit\" name=\"login\" value=\"Login\">
</td></tr><tr>
<td align=\"center\">
<a href=\"register.php\" target=\"middle\">Register Here</a>
</td>
</tr></table></form></center>");
}
if ($_POST[login]) {
// the form has been submitted. We continue...
$username=$_POST['username'];
$password = md5($_POST[password]);
// the above lines set variables with the submitted information.
$info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);
if($data[password] != $password) {
// the password was not the user's password!
echo "<meta http-equiv=\"Refresh\" content=\"2; URL=login.php\"/><center>Incorrect username or password!<br><br>Please Wait</center>";
}else{
// the password was right!
$profile = mysql_query("SELECT * FROM users WHERE username = '$logged[username]'") or die(mysql_error());
$query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);
$date = date("j F G : i");
if($user[level] == 11){
mysql_query("INSERT INTO `modlogins` (`id` , `description` ) VALUES (NULL , '$user[username] :::: $date')");
}
// gets the user's information
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
mysql_query("INSERT INTO `logins` (`id`, `username` , `description` ) VALUES (NULL , '$user[username]' , '$date')");
// the above lines set 2 cookies. 1 with the user's id and another with his/her password.
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=login.php\"/><center>Thank You! You will be redirected</center>");
// modify the above line...add in your site url instead of yoursite.com
}
}
else
{
$profile = mysql_query("SELECT * FROM users WHERE username = '$logged[username]'") or die(mysql_error());
$new = mysql_query("select * from pmessages where unread = 'unread' and touser = '$logged[username]'");
$new = mysql_num_rows($new);
$pms = mysql_query("select * from pmessages where touser = '$logged[username]'");
$pms = mysql_num_rows($pms);
$rquery = mysql_query("SELECT * FROM cfh"); # Queries The Call For Help Messages
while($m=mysql_fetch_array($rquery)) # Displays Them All In Order
// we now display the user controls.
if($logged[username] && $logged[level] == 0 ){
echo "<p>Sorry, you are banned. And therefore cannot view this page!</p><p>To have the ban lifted, email [email protected] and we will look into the case.</p>";
}
if($logged[username] && $logged[level] >= 1)
{
echo ("<p>Welcome <span class='$logged[level]'><b>$logged[username]</b></span>!<br>
- <a href=\"select_badge.php\" target=\"middle\">Set Display Badge</a><br />
- <a href=\"messages.php\" target=\"middle\">Message Center</a> ");
include("new.php");
echo("<br />
- <a href=\"members.php\" target=\"middle\">Members List</a><br />
- <a href=\"values_1.php\" target=\"middle\">Rare Values</a><br />
- <a href=\"badges.php\" target=\"middle\">Badges List</a><br />
- <a href=\"rooms.php\" target=\"middle\">Chatrooms</a><br />
- <a href=\"contact.php\" target=\"middle\">Help Tool</a><br />
- <a href=\"logout.php\" target=\"login\">Logout</a><br /> ");
if($logged[username] && $logged[level] == 12)
echo "- <a href=\"admin/index.php\" target=\"middle\">Admin Panel</a><br/>";
if($logged[username] && $logged[level] == 11 || $logged[level] == 12)
echo "- <a href=\"mod/index.php\" target=\"middle\">Mod Panel</a><br />";
if($logged[username] && $logged[level] == 9 || $logged[level] == 12)
echo "- <a href=\"managers/index.php\" target=\"middle\">Managers Panel</a><br />";
if($logged[username] && $logged[level] == 10 || $logged[level] == 12)
echo "- <a href=\"support/index.php\" target=\"middle\">Player Support</a><br />";
}
}
}
?>
<html>
<head>
<title>Home</title>
<style type="text/css">
a {
font-size: 10px;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body,td,th,p {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
.12 { color: red; }
.11 { color: navy; }
.10 { color: ; }
.9 { color: darkorchid; }
.8 { color: darkorchid; }
.7 { color: darkorchid; }
.6 { color: darkorchid; }
.5 { color: green; }
.4 { color: green; }
.3 { color: green; }
.2 { color: green; }
.1 { color: black; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
width: 100;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
select {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 100;
border: 1px solid #000000;
}
textarea {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 100;
border: 1px solid #000000;
}

</style>
<meta http-equiv=\"Refresh\" content=\"30; URL=login.php\"/>
</head>
<body bgcolor="transparent">
</body>
</html>
<?
if ($logged[banned] == 'banned') {
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=banned.php\"/>");
}
?>

chrisgocrazyH
18-01-2008, 01:54 PM
i have dosent work ill just use Cjs

Hitman
18-01-2008, 02:12 PM
i have dosent work ill just use CjsDoes it still come up with an error, if so which one?

Try this...


<?
ob_start();
// allows you to use cookies.
include("config.php");
if (!$logged[username])
{
if (!$_POST[login])
{
echo("
<center><form method=\"POST\">
<table>
<tr>
<td align=\"center\">
Username: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\">
</td>
</tr>
<tr>
<td align=\"center\">
Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"password\">
</td></tr><tr>
<td align=\"center\">
<input type=\"submit\" name=\"login\" value=\"Login\">
</td></tr><tr>
<td align=\"center\">
<a href=\"register.php\" target=\"middle\">Register Here</a>
</td>
</tr></table></form></center>");
} else {
if ($_POST[login]) {
// the form has been submitted. We continue...
$username=$_POST['username'];
$password = md5($_POST[password]);
// the above lines set variables with the submitted information.
$info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);
if($data[password] != $password) {
// the password was not the user's password!
echo "<meta http-equiv=\"Refresh\" content=\"2; URL=login.php\"/><center>Incorrect username or password!<br><br>Please Wait</center>";
}else{
// the password was right!
$profile = mysql_query("SELECT * FROM users WHERE username = '$logged[username]'") or die(mysql_error());
$query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);
$date = date("j F G : i");
if($user[level] == 11){
mysql_query("INSERT INTO `modlogins` (`id` , `description` ) VALUES (NULL , '$user[username] :::: $date')");
}
// gets the user's information
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
mysql_query("INSERT INTO `logins` (`id`, `username` , `description` ) VALUES (NULL , '$user[username]' , '$date')");
// the above lines set 2 cookies. 1 with the user's id and another with his/her password.
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=login.php\"/><center>Thank You! You will be redirected</center>");
// modify the above line...add in your site url instead of yoursite.com
}
}
}
}
else
{
$profile = mysql_query("SELECT * FROM users WHERE username = '$logged[username]'") or die(mysql_error());
$new = mysql_query("select * from pmessages where unread = 'unread' and touser = '$logged[username]'");
$new = mysql_num_rows($new);
$pms = mysql_query("select * from pmessages where touser = '$logged[username]'");
$pms = mysql_num_rows($pms);
$rquery = mysql_query("SELECT * FROM cfh"); # Queries The Call For Help Messages
while($m=mysql_fetch_array($rquery)) # Displays Them All In Order
// we now display the user controls.
if($logged[username] && $logged[level] == 0 ){
echo "<p>Sorry, you are banned. And therefore cannot view this page!</p><p>To have the ban lifted, email [email protected] and we will look into the case.</p>";
}
if($logged[username] && $logged[level] >= 1)
{
echo ("<p>Welcome <span class='$logged[level]'><b>$logged[username]</b></span>!<br>
- <a href=\"select_badge.php\" target=\"middle\">Set Display Badge</a><br />
- <a href=\"messages.php\" target=\"middle\">Message Center</a> ");
include("new.php");
echo("<br />
- <a href=\"members.php\" target=\"middle\">Members List</a><br />
- <a href=\"values_1.php\" target=\"middle\">Rare Values</a><br />
- <a href=\"badges.php\" target=\"middle\">Badges List</a><br />
- <a href=\"rooms.php\" target=\"middle\">Chatrooms</a><br />
- <a href=\"contact.php\" target=\"middle\">Help Tool</a><br />
- <a href=\"logout.php\" target=\"login\">Logout</a><br /> ");
if($logged[username] && $logged[level] == 12)
echo "- <a href=\"admin/index.php\" target=\"middle\">Admin Panel</a><br/>";
if($logged[username] && $logged[level] == 11 || $logged[level] == 12)
echo "- <a href=\"mod/index.php\" target=\"middle\">Mod Panel</a><br />";
if($logged[username] && $logged[level] == 9 || $logged[level] == 12)
echo "- <a href=\"managers/index.php\" target=\"middle\">Managers Panel</a><br />";
if($logged[username] && $logged[level] == 10 || $logged[level] == 12)
echo "- <a href=\"support/index.php\" target=\"middle\">Player Support</a><br />";
}
}
?>
<html>
<head>
<title>Home</title>
<style type="text/css">
a {
font-size: 10px;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body,td,th,p {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
.12 { color: red; }
.11 { color: navy; }
.10 { color: ; }
.9 { color: darkorchid; }
.8 { color: darkorchid; }
.7 { color: darkorchid; }
.6 { color: darkorchid; }
.5 { color: green; }
.4 { color: green; }
.3 { color: green; }
.2 { color: green; }
.1 { color: black; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
width: 100;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
select {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 100;
border: 1px solid #000000;
}
textarea {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 100;
border: 1px solid #000000;
}

</style>
<meta http-equiv=\"Refresh\" content=\"30; URL=login.php\"/>
</head>
<body bgcolor="transparent">
</body>
</html>
<?
if ($logged[banned] == 'banned') {
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=banned.php\"/>");
}
?>

EDIT: Updated code, try it now.

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