[MYSLQI][OOP PHP] HybridBirdCMS

Status
Not open for further replies.

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
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)


thx 4 reading.
 

GarettM

Posting Freak
Aug 5, 2010
833
136
I feel like the name you wanted was HybridCMS i am one the developers for it Xd we are still developing for it but you can use are login class because well yours suck.
 

hybridbird

New Member
Oct 15, 2013
4
0
I feel like the name you wanted was HybridCMS i am one the developers for it Xd we are still developing for it but you can use are login class because well yours suck.
ow sorry, i just like took my username and added cms, lol. But anyways, holy fuck, thank you for the codes. I need to google some things u wrote in the code which i don't really know what it does. Thank you again!
 

GarettM

Posting Freak
Aug 5, 2010
833
136
ow sorry, i just like took my username and added cms, lol. But anyways, holy fuck, thank you for the codes. I need to google some things u wrote in the code which i don't really know what it does. Thank you again!
Just ask me and ill tell you?
you know HybridCMS needs programmers right know its just me and i could use some help :D
 

hybridbird

New Member
Oct 15, 2013
4
0
Just ask me and ill tell you?
you know HybridCMS needs programmers right know its just me and i could use some help :D
Well I'm programming c++ a bit and i know what the "switch" does in c++, but i didn't know if it existed in php. haha, well now i do.

haha, if you're about to ask me to help you, i dunno if i can, it seems like i'm not on ur level , lol.
 

GarettM

Posting Freak
Aug 5, 2010
833
136
Well I'm programming c++ a bit and i know what the "switch" does in c++, but i didn't know if it existed in php. haha, well now i do.

haha, if you're about to ask me to help you, i dunno if i can, it seems like i'm not on ur level , lol.
We all have to start somewhere man X) and if php isn't your thing c++ could help a lot and web design ^.~
 

hybridbird

New Member
Oct 15, 2013
4
0
We all have to start somewhere man X) and if php isn't your thing c++ could help a lot and web design ^.~
I agree. But web design is seriously not my thing. I'm actually really bad in web design. that's why the index looks like shit. I started c++ like 2 years ago and coded for about 1 month but it got boring and i stopped coding. And now i'm back with c++.
But i'm studying php alot atm.
I don't know mate, i'll maybe just throw php away and only code c++.
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
Not much there. Goodluck doe. I could fix you up an admin panel when you are about done.
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
I could make him a theme. If he wants me too. I am pretty decent when it comes down to themes
 

Jeffrey

Devbest Indian Tech Support
FindRetros Moderator
Feb 5, 2013
1,180
412
I agree. But web design is seriously not my thing. I'm actually really bad in web design. that's why the index looks like shit. I started c++ like 2 years ago and coded for about 1 month but it got boring and i stopped coding. And now i'm back with c++.
But i'm studying php alot atm.
I don't know mate, i'll maybe just throw php away and only code c++.

@TruCluez @Ultra will explain why..
 

TruCluez

Posting Freak
Oct 14, 2013
513
62
tbh just take the Big ugly logo. (HYBIRD CMS away. and add it smaller. and where it says login make a clear box and put the LOGIN Info and a img of a hotel view or somn and put a regiser on da right! den boom its ok
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Why the hell do you run a while loop on login? LOL, you only need to run num rows check. And same with the userInfo, no loop needed - simply fetch assoc.
 
Status
Not open for further replies.

Users who are viewing this thread

Top