hybridbird
New Member
- Oct 15, 2013
- 4
- 0
Hello.
I've started developing a habbo cms called HybridBirdCMS from scratch, based on MYSQLI & OOP PHP.
So i'm pretty new in this forum and I would like to introduce myself.
Call me Bird i guess, lol.
I'm 15 years old I'll be 16 in December. I started coding PHP and HTML about 4-5 months ago. I started mysqli and oop php about 2-3 weeks ago.
This is also my first habbo cms i'm coding.
Anyways here are some snippets:
( THE DESIGN IS NOT DONE YET. I'LL FIX IT LATER ))
// LOGIN
// MYSQLI CONNECTION
// USER INFO
// GLOBAL.PHP
// CONFIG
To do:
Register
Me
Client
Staff
Home
Settings
Housekeeping
And alot more
Print screen: (only one atm)
thx 4 reading.
I've started developing a habbo cms called HybridBirdCMS from scratch, based on MYSQLI & OOP PHP.
So i'm pretty new in this forum and I would like to introduce myself.
Call me Bird i guess, lol.
I'm 15 years old I'll be 16 in December. I started coding PHP and HTML about 4-5 months ago. I started mysqli and oop php about 2-3 weeks ago.
This is also my first habbo cms i'm coding.
Anyways here are some snippets:
( THE DESIGN IS NOT DONE YET. I'LL FIX IT LATER ))
// LOGIN
PHP:
public $log_username;
public $log_password;
public $log_q;
public function userlogin(){
if(isset($_POST['logButton'])){
$this->log_username = $this->ENGINE->real_escape_string(strip_tags($_POST['username']));
$this->log_password = $this->ENGINE->real_escape_string(strip_tags($_POST['password']));
if(!empty($this->log_username) && !empty($this->log_password)){
$this->log_q = $this->ENGINE->query("SELECT * FROM users WHERE username='" . $this->log_username . "' AND password='" . $this->log_password . "'");
if($this->log_q->num_rows != 0){
while($userExists = $this->log_q->fetch_assoc()){
$_SESSION['username'] = $userExists['username'];
header("Location: me.php");
}
}else{
die("User does not exist in our database!");
}
}else{
die("You cannot leave field(s) empty!");
}
}
}
// MYSQLI CONNECTION
PHP:
public $ENGINE;
public function __construct($hostname, $hostuser, $hostpass, $hostdb){
$this->ENGINE = new mysqli($hostname, $hostuser, $hostpass, $hostdb);
if($this->ENGINE->connect_errno){
echo '<h3 style="color:red;font-family:tahoma"> ENGINE SAYS: Could not connect to the database. <br>
Please check your configurations, conf.php</h3>';
}
}
// USER INFO
PHP:
public $q_user;
public function showInfo($username){
$this->q_user = $this->ENGINE->query("SELECT * FROM users WHERE username='$username'");
while($info = $this->q_user->fetch_assoc()){
$_SESSION['id'] = $info['id'];
$_SESSION['coins'] = $info['credits'];
$_SESSION['look'] = $info['look'];
$_SESSION['pixels'] = $info['activity_points'];
$_SESSION['mail'] = $info['mail'];
$_SESSION['motto'] = $info['motto'];
$_SESSION['last_online'] = $info['last_online'];
$_SESSION['online'] = $info['online'];
$_SESSION['ip_login'] = $info['ip_last'];
$_SESSION['reg_ip'] = $info['ip_reg'];
$_SESSION['rank'] = $info['rank'];
}
}
// GLOBAL.PHP
PHP:
<?php
session_start();
require_once('publicengine.php');
require_once('conf.php');
$publicEngine = new Engine($hostname, $hostuser, $hostpass, $hostdb);
@$username = $_SESSION['username'];
@$coins = $_SESSION['coins'];
@$look = $_SESSION['look'];
@$pixels = $_SESSION['pixels'];
@$email = $_SESSION['mail'];
@$motto = $_SESSION['motto'];
@$lastOnline = $_SESSION['last_online'];
@$online = $_SESSION['online'];
@$loginIP = $_SESSION['ip_login'];
@$regIP = $_SESSION['reg_ip'];
@$rank = $_SESSION['rank'];
@$id = $_SESSION['id'];
?>
// CONFIG
PHP:
$hostname = "localhost";
$hostuser = "root";
$hostpass = "";
$hostdb = "phptest";
$hotelname = "Hybrid-Bird CMS";
$startcoins = 30000; // Start coins
$startpixels = 10000; // Start pixels
To do:
Register
Me
Client
Staff
Home
Settings
Housekeeping
And alot more
Print screen: (only one atm)
You must be registered for see links
thx 4 reading.