IIS7 php.ini problems

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
Well, was not sure where to put this as i'm not sure it's habbo related or not.

I'm using a CMS Made by Xenous (he looked at the problem and it wasn't in his CMS). And when people register they get sent to the me page, yet their information doesn't get inserted to the database. He suggested it might lay in my IIS7 configuration/php.ini file. Any idea what to look for in there?
 

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
I am bit clueless about your problem. Do you mean that after they register they get to me.php page but it seems they are not logged in?
I mean, they finish register, it doesn't insert to the database and still sends them not-registered to the me page.

Screenie:
480063178587.png

Weird part was that it was working 100% fine before i moved on to my new VPS..
 

Gajeel

Well-Known Member
Oct 4, 2011
2,411
413
I am clueless. If ever no one can answer it, you can try redirecting them back to index or make another index with a notice saying "Thank you for registering, you may now login." or something similar.
 

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
I am clueless. If ever no one can answer it, you can try redirecting them back to index or make another index with a notice saying "Thank you for registering, you may now login." or something similar.
That's the problem, that won't work either. When there is nothing in the database to fetch that is close to any of that information provided, this shouldn't be possible..

As Xeno said, most likely a php.ini problem. But i have no clue to fix it..
 

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
Nope. Nothing at all..

PHP:
<?php
require_once "global.php";
 
define('Error1', '<div id="error-messages-container" class="cbb"><div class="rounded" style="background-color: #cb2121;"><div id="error-title" class="error">');
define('Error2', '</div></div></div>');
 
if(isset($_SESSION['doHabbo'])) {
   
    header("Location: me");
}
 
if(isset($_POST['register'])) {
   
    $username = $core->clean($_POST['regUser']);
    $password = $core->clean($_POST['regPass']);
    $check = $core->clean($_POST['regCheck']);
    $email = $core->clean($_POST['regEmail']);
    $ip = $_SERVER['REMOTE_ADDR'];
       
        if($username !== null && $password !== null) {
           
            if($users->validName($username) && strlen($username) <= 32) {
               
                if($password == $check && strlen($password) >= 8) {
                   
                    if(!$users->isBanned($ip)) {
                       
                        if(!$users->nameTaken($username)) {
                           
                            $users->addUser($username, $password, $email, 'Raz0r.', 50000, 5000, 1, 'hd-80', $ip);
                            $users->makeSSO($username);
                            $_SESSION['doHabbo'] = $username;
                            header("Location: me");
                        }
                        else {
                           
                            $tpl->setParam('error', Error1 . 'That name is taken.' . Error2);
                        }
                       
                    }
                    else {
                       
                        $tpl->setParam('error', Error1 . 'Sorry it appears you are ip banned.' . Error2);
                    }
                   
                }
                else {
                   
                    $tpl->setParam('error', Error1 . 'Your passwords don\'t match. Or aren\'t long enough.' . Error2);
                }
               
            }
            else {
               
                $tpl->setParam('error', Error1 . 'Please enter a valid name.' . Error2);
            }
           
        }
        else {
           
            $tpl->setParam('error', Error1 . 'Please fill in all fields.' . Error2);
        }
}
 
$tpl->doTop('%hotelName% - Register');
$tpl->getPage('register');
$tpl->doBottom();
$tpl->output();
?>
 

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
PHP:
 public function addUser($user, $pass, $email, $motto, $credits, $pixels, $rank, $look, $gender, $ip) {
       
        mysql_query("INSERT INTO `users` (`username`, `password`, `mail`, `motto`, `credits`, `activity_points`, `rank`, `look`, `gender`, `ip_last`, `ip_reg`, `account_created`, `last_online`) VALUES ('$user', 'md5($pass)', '$email', '$motto', '$credits', '$pixels', '$rank', '$look', '$gender', '$ip', '$ip', 'time()', 'time()') LIMIT 1");
    }
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
PHP:
 public function addUser($user, $pass, $email, $motto, $credits, $pixels, $rank, $look, $gender, $ip) {
     
        mysql_query("INSERT INTO users (username, password, mail, motto, credits, activity_points, rank, look, gender, ip_last, ip_reg, account_created, last_online) VALUES ('{$user}', '" . md5($pass) . "', '{$email}', '{$motto}', '{$credits}', '{$pixels}', '{$rank}', '{$look}', '{$gender}', '{$ip}', '{$ip}', '" . time() . "', '" . time() . "')") or die(mysql_error());
    }

It looks like he doesn't know what he's doing, I'd recommend using another CMS -- but it's up to you.

Anyways, that should fix it or at least throw an error.
 

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
PHP:
 public function makeSSO($user) {
       
        $sso = rand(1, 999);
        $sso .= '-' . $user;
        $sso .= '-doHabbo-';
        $sso .= time();
            return mysql_query("UPDATE `users` SET `auth_ticket` = '$sso' WHERE `username` = '$user' LIMIT 1");
    }

And the error: Field 'auth_ticket' doesn't have a default value
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
PHP:
 public function makeSSO($user) {
    
        $sso = rand(1, 999) . '-' . $user . '-doHabbo-' . time();
 
        mysql_query("UPDATE users SET auth_ticket = '{$sso}' WHERE username = '{$user}' LIMIT 1") or die(mysql_error());
    }

pew pew, see if that works.
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
Ok, I get it -- There's nothing wrong with that function. The problem is with the addUser function, because it's not inserting an SSO when it doesn't have a default value.

Change both of them to this:
PHP:
 public function makeSSO($user) {
   
        $sso = rand(1, 999) . '-' . $user . '-doHabbo-' . time();
 
        return $sso;
    }

PHP:
 public function addUser($user, $pass, $email, $motto, $credits, $pixels, $rank, $look, $gender, $ip) {
   
        mysql_query("INSERT INTO users (username, password, mail, motto, credits, activity_points, rank, look, gender, ip_last, ip_reg, account_created, last_online, auth_ticket) VALUES ('{$user}', '" . md5($pass) . "', '{$email}', '{$motto}', '{$credits}', '{$pixels}', '{$rank}', '{$look}', '{$gender}', '{$ip}', '{$ip}', '" . time() . "', '" . time() . "', '" . $this->makeSSO($user) . "')") or die(mysql_error());
    }
 

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
Data truncated for column 'gender' at row 1

I just find it weird though, it worked fine before i switched to the new VPS.. What could've caused it to go straight to hell after that?
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
Data truncated for column 'gender' at row 1

I just find it weird though, it worked fine before i switched to the new VPS.. What could've caused it to go straight to hell after that?

I suspect the database was different plus, the guy who made this has no idea what he's doing.

Change this:
PHP:
 $users->addUser($username, $password, $email, 'Raz0r.', 50000, 5000, 1, 'hd-80', $ip);
to this:
PHP:
 $users->addUser($username, $password, $email, 'Raz0r.', 50000, 5000, 1, 'hd-80', 'M', $ip);
 

Users who are viewing this thread

Top