PDA

View Full Version : [Help] OurHabbo Login



IMole
05-08-2007, 08:43 PM
I know I keeping posting a lot of things about OH a lot but the major things are sorted, I just need this tiny thing sorted. A lot of browsers don't allow redirecting for some people, they say it just says thank you for logging in redirecting and nothing else happens, is there away I could change this so instead of it redirecting, it checks all data is correct and everything but as soon as they login it checks and shows the menu straight away instead of it redirecting so for example.

I login password and user name are right, if they match on database it'll just show the menu instead of redirecting.

Hope you made sense of my babbling here's the login page:



<?
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:<br>
<input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\">
</td>
</tr>
<tr>
<td align=\"center\">
Password:<br>
<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=\"content\">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=\"1; 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=\"content\">Set Display Badge</a><br />
- <a href=\"messages.php\" target=\"content\">Message Center</a> ");
include("new.php");
echo("<br />
- <a href=\"members.php\" target=\"content\">Members List</a><br />
- <a href=\"badges.php\" target=\"content\">Badges List</a><br />
- <a href=\"rooms.php\" target=\"content\">Chatrooms</a><br />
- <a href=\"c4h.php\" target=\"content\">Call For Help</a><br />
- <a href=\"logout.php\">Logout</a><br /> ");
if($logged[username] && $logged[level] == 12)
echo "- <a href=\"http://h1.ripway.com/aaronnaughton/admin.php\" target=\"content\">Admin Panel</a><br/>";
if($logged[username] && $logged[level] == 11 || $logged[level] == 12)
echo "- <a href=\"http://h1.ripway.com/aaronnaughton/mod.php\" target=\"content\">Mod Panel</a><br />";
if($logged[username] && $logged[level] == 9 || $logged[level] == 12)
echo "- <a href=\"http://h1.ripway.com/aaronnaughton/managers.php\" target=\"content\">Managers Panel</a><br />";
if($logged[username] && $logged[level] == 10 || $logged[level] == 12)
echo "- <a href=\"http://h1.ripway.com/aaronnaughton/support.php\" target=\"content\">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="#ffffff">
</body>
</html>
<?
if ($logged[banned] == 'banned'){
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=banned.php\"/>");
}
?>


I hope you can help me lol this'll be the last thing I need sorting now.

Lilian
05-08-2007, 11:00 PM
I don't see a problem with it. Why not just use a hyperlink to the menu? www.techtuts.com - the OH usersystem is from there. Your best just reading the tutorials and building it yourself.

IMole
05-08-2007, 11:01 PM
Yeah there's nothing wrong with it but it doesn't redirect people I wanted to know if I can cut the redirect bit out and have it just view the menu.

Lilian
05-08-2007, 11:03 PM
Yes you can.

IMole
05-08-2007, 11:04 PM
Ok then how? I've tried jsut removing or putting menu there instead but it just says error can someone possibly edit what I've posted up there and post it back so it does just that?

EDIT: Sorry for being a noob, I've only just started PHP

Lilian
05-08-2007, 11:09 PM
Use a hyperlink as I said and make the link login.php.

IMole
05-08-2007, 11:10 PM
I tried it but it just says this:


Parse error: parse error, unexpected T_STRING in /home/www/saturdayhabbo1.freehostia.com/OHUsersystem_v500/upload/login.php on line 55

and that's where I put hyperlink

IMole
05-08-2007, 11:14 PM
Aha, I might have fixed it... lemme test

EDIT: Works like a dream I found out what was wrong but thanks for the help any way, my hyperlink wasn't right I put it as the good old <a href=> but it needed to be <a href=\"\">

EDIT: I need to spread some rep before I give some to you, I owe some to you ;]

Edited by NintendoNews (Forum Moderator): Please do not double post.

Lilian
05-08-2007, 11:15 PM
Because you proberly added " instead of going \". Post the code.

IMole
05-08-2007, 11:20 PM
You were right, all sorted now. +rep for help I bet I'm an annoying noob who's being a pain. I need to spread some rep before I give.

EDIT: The people said they still can't get on it, it says redirecting then nothing else happens even when they click link. G2g I'll check back tomoz.

Lilian
05-08-2007, 11:22 PM
Post a link so I can test please.

IMole
06-08-2007, 12:08 PM
http://www.SaturdayHabbo.co.uk

See even if I login and press escape it still works but for some people it doesn't go past the redirecting page.

Heinous
06-08-2007, 01:11 PM
Spit out

header("Location: ./url.ext");

You'd change the bolded. Wouldn't show a redirect, would just be done.

IMole
06-08-2007, 08:13 PM
But the location is the same page...

Lilian
06-08-2007, 08:19 PM
It works perfectly from me. Ask your users to delete there cookies and internet history then retry.

IMole
06-08-2007, 10:43 PM
Ok, ty.

IMole
07-08-2007, 10:02 PM
Is it something to do with IE and Firefox because I tried it on computer downstairs on IE and it logs in says redirectnig but redirects to the login form again. I've tried deleting history cookies and what not and it didn't work, I should have tried on firefox now, I'll try on firefox tomoz.

EDIT: The user who couldn't login tried netscape and it worked fine, so it doesn't work on IE so problem fixed close thread.

PixelWill
11-08-2007, 10:51 AM
That's the layout from HabboXtra (Official AU Fansite)

Thought I recognised it.

Sunny.
11-08-2007, 10:58 AM
http://habboxtra.net/

1 Thing least SaturdayHabbo loads faster "/
HabboXtra is pathetic. Hardly loads.. But it looks like a rip th.

Habboxtra is a total rip of clubhabbo LOL

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