Re: Project Juliet - Source Code [PHP, MySQL]
@PowahAlert
CODE LIKES TO BE INDENTED! It makes it happy ;3
PHP Code:
<?php
/*---------------------------------------------*
* MACRO CMS REVISION 2 - CODE NAMED: ANSI *
*----------------------------------------------*
* AUTHOR: LIVAR SHEKHANI (POWAHALERT) *
*----------------------------------------------*
* COMPATIBLE FOR PHOENIX EMULATOR (OTAKU) *
*----------------------------------------------*/
class Core
{
function Hash($input)
{
$salt = "FDFSDGDD[OF0386WH'#]SPHGYR";
return sha1($input . $salt);
}
function Filter($input)
{
return mysql_real_escape_string($input);
}
function Trunk()
{
return "MacroCMS Revision 2 - CODE NAMED: ANSI";
}
function UI($username, $row)
{
$query = @mysql_result(mysql_query("SELECT $row FROM users WHERE username = '$username' LIMIT 1"), 0);
return $query;
}
function UO()
{
$query = @mysql_result(mysql_query("SELECT users_online FROM server_status LIMIT 1"), 0);
echo $query;
}
function CheckLogin()
{
if(isset($_SESSION['M_USER']))
{
return true;
}
else
{
return false;
}
}
function Login()
{
$username = $this->Filter($_POST['username']);
$password = $this->Hash($_POST['password']);
$correct = $this->UI($username, 'password');
if(empty($username))
{
echo "Enter a username";
exit;
}
if($password == $correct)
{
// User's Password is correct!
$_SESSION['M_USER'] = $username;
$_SESSION['M_PASS'] = $password;
Header("Location: me.php");
}
elseif(mysql_num_rows(mysql_query("SELECT * FROM users WHERE username='$username'")) == 0)
{
echo "That user does not exist!";
exit;
}
elseif($password != $correct)
{
echo "Password is incorrect!";
exit;
}
}
}
?>
Re: Project Juliet - Source Code [PHP, MySQL]
This will one day be great...
Re: Project Juliet - Source Code [PHP, MySQL]
I'm so tired of this. Everyone on RaGEZONE only release not finished and shit Emulators. Can you please be the first that release a stable Emulator with everyhthing fixed?
Re: Project Juliet - Source Code [PHP, MySQL]
Quote:
Originally Posted by
djboetz
I'm so tired of this. Everyone on RaGEZONE only release not finished and shit Emulators. Can you please be the first that release a stable Emulator with everyhthing fixed?
We can also release nothing...
Re: Project Juliet - Source Code [PHP, MySQL]
Quote:
Originally Posted by
djboetz
I'm so tired of this. Everyone on RaGEZONE only release not finished and shit Emulators. Can you please be the first that release a stable Emulator with everyhthing fixed?
WTF, this is a PHP website!!! :wacko:
Re: Project Juliet - Source Code [PHP, MySQL]
If you guys would like to checkout what is going to happen with Project Juliet please visit the Development thread.
http://forum.ragezone.com/f331/proje...ml#post6788756
Re: Project Juliet - Source Code [PHP, MySQL]
Quote:
Originally Posted by
AmirZ
WTF, this is a PHP website!!! :wacko:
Where you got that idea from? RaGEZONE supports everything, css html php java javascript. Its not only a PHP website. lol
Re: Project Juliet - Source Code [PHP, MySQL]
Quote:
Originally Posted by
ησвяαιη
Not trying to rage at you but, ARE YOU FUCKING DUMB? He was clearly referring to my CMS, which is coded in PHP.
Oh my bad =)
Also long time no see Ash :P
Its Queue by the way
Re: Project Juliet - Source Code [PHP, MySQL]
You can improve even im not amazing but i see somethings you can change
Re: Project Juliet - Source Code [PHP, MySQL]
Post on my development thread since none of you are checking.
Quote:
Decided to take a little break and review my code, possibly even recode it as I not happy. I will take in a few ideas you guys have told me, thanks for all your ideas/support to help me with my PHP. :)
Development will continue in a few days(3 maximum), possibly earlier.
------------------------
Build 2 is going to be good.
MySQLi/MySQL connection system began :P
PHP Code:
public function __construct($dbhostname, $dbusername, $dbpassword, $dbname, $contype) {
if ($contype == "mysqli") {
$this->connection = mysqli_connect($dbhostname, $dbusername, $dbpassword);
$this->database = mysqli_select_db($dbname);
}
else {
$this->connection = mysql_connect($dbhostname, $dbusername, $dbpassword);
$this->database = mysql_select_db($dbname);
}
}
Re: Project Juliet - Source Code [PHP, MySQL]
Why not forced MySQLi? What about when you use bind_param you have to do an if statement to change all the MySQLi to something else, not worth. Might aswell just only support MySQLi - it is better anyway.
Re: Project Juliet - Source Code [PHP, MySQL]
Quote:
Originally Posted by
Hejula
Why not forced MySQLi? What about when you use bind_param you have to do an if statement to change all the MySQLi to something else, not worth. Might aswell just only support MySQLi - it is better anyway.
I was thinking the same? LOL
Thanks for the information matey, forced MySQLi it is. :P
Re: Project Juliet - Source Code [PHP, MySQL]
Quote:
Originally Posted by
ησвяαιη
Post on my development thread since none of you are checking.
------------------------
Build 2 is going to be good.
MySQLi/MySQL connection system began :P
PHP Code:
public function __construct($dbhostname, $dbusername, $dbpassword, $dbname, $contype) {
if ($contype == "mysqli") {
$this->connection = mysqli_connect($dbhostname, $dbusername, $dbpassword);
$this->database = mysqli_select_db($dbname);
}
else {
$this->connection = mysql_connect($dbhostname, $dbusername, $dbpassword);
$this->database = mysql_select_db($dbname);
}
}
1.- Bad way of making 'multiple support'.
2.- MySQLi should 'be used as OOP'
Just saying.
Re: Project Juliet - Source Code [PHP, MySQL]
Quote:
Originally Posted by
Kryptos
1.- Bad way of making 'multiple support'.
2.- MySQLi should 'be used as OOP'
Just saying.
I'm just experimenting at the moment, and I don't know OOP. Check the development thread for a change of the code.
Re: Project Juliet - Source Code [PHP, MySQL]
Quote:
Originally Posted by
ησвяαιη
I'm just experimenting at the moment, and I don't know OOP. Check the development thread for a change of the code.
You don't know OOP? 0_o
Then why is that snippet in a construct?