• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

xCMS

Status
Not open for further replies.
Try adding a semi colon ( ; ) at the very end of line 101 in index.php :p
 
Show me lines 98-105 and I'll see what I can do. ;)
 
hmm, now i get a brown background and the rest is still white :( ehm i dont know how to send a screen here else i would show you how it looks like.

btw here are the lines: 98 to lik 115 or sumthing :p

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
//Head
echo "<head>\n";
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\"/>\n";
echo "<meta name=\"description\" content=\"\"/>\n";
echo "<meta name=\"keywords\" content=\"\"/> \n";
echo "<meta name=\"author\" content=\"Oceanic\"/> \n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href="skins\style.css" media=\"screen\"/>\n";
echo "<title>".$title."</title>\n";
echo "</head>\n"
 
I can't really see any issues in that piece of code, unless you didn't copy the entire last line as it's missing a semi colon ( ; ).
 
heres some more (that was under it)

PHP:
echo "<body>\n";
echo "<div id=\"wrapper\">\n";
echo "<div id=\"container\">\n";

echo "<div class=\"title\">\n";
    
echo "    <h1><a href=\"index.php\">".$title."</a></h1>\n";

echo "</div>\n";

echo "<div class=\"header\"></div>\n";

//Menu
echo "<div class=\"navigation\">\n";
echo "<a href=\"?page=Home\">Home</a>\n";
    if($_SESSION["logged_in"] == 1){
    echo "<a href=\"?page=Account\">Account</a>\n";
        if($_SESSION["admin"] == 1){
        echo "<a href=\"?page=Admin\">Admin</a>\n";
        }
    }else{
    echo "<a href=\"?page=Login\">Login</a>\n";
    }
    
echo "<a href=\"?page=Search\">Search</a>\n";
echo "<a href=\"?page=Highscore\">Highscore</a>\n";
echo "    <div class=\"clearer\"></div>\n";
echo "</div>\n";
 
Last edited by a moderator:
Could you put the entire field, inside a
Code:
 or [php] tag? Would ease it up a lot.
 
Just write
PHP:
 the file contents in here and then end it with [/ php] (remove the whitespace between the slash and the word 'php' in the ending tag).
 
PHP:
     Author: Oceanic
    Product Name: xCMS
    Purpose: To easy manage Opentibia servers, and to be a good CMS

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

session_start();
include "config.php";
error_reporting($error_reporting);
mysql_connect($connection[1], $connection[2], $connection[3]) or die("Could not connect, please check your settings");
mysql_select_db($connection[4]) or die("Database dont exist");

////////////////////////////////////
//	Search player
////////////////////////////////////

if(!empty($_POST["search_name"])){
	
	$name = mysql_escape_string($_POST["search_name"]);
	$player_check = mysql_query("SELECT * FROM players WHERE name='$name'") or die(mysql_error());
		if (mysql_num_rows($player_check) == 0){
		$player_dont_exist = "<p>Player dont exist</p>\n";
		}else{
		header("Location: ?page=Search&name=".preg_replace("/".chr(32)."/", "_", $_POST["search_name"]));
		}
}

////////////////////////////////////
//	Login
////////////////////////////////////

if(!empty($_POST["login_number"]) && !empty($_POST["login_password"])){
	
	$account_number = mysql_escape_string($_POST["login_number"]);
		if($use_md5 == true){
		$account_passoword = mysql_escape_string($_POST["login_password"]);
		$account_passoword = md5($account_passoword);
		}else{
		$account_passoword = mysql_escape_string($_POST["login_password"]);
		}
	

	
	if(!empty($_COOKIE["name"]) && !empty($_COOKIE["password"]) && $_POST["remember"] != true){
	setcookie("name","");
	setcookie("password","");
	}
	

	$get_account_data = mysql_query("SELECT * FROM accounts WHERE id='$account_number'") or die(mysql_error());
	
	if (mysql_num_rows($get_account_data) != 0){
		$data = mysql_fetch_array( $get_account_data );

		if($account_number == $data['id'] && $account_passoword == $data['password']){
			if($data['group_id'] > 1){
			$_SESSION["logged_in"] = 1;
			$_SESSION["admin"] = 1;
			$_SESSION["account_number"] = $account_number;
			
			}else{
			$_SESSION["logged_in"] = 1;
			$_SESSION["account_number"] = $account_number;
			}
			if($_POST["remember"] == true){
			setcookie("name",md5($account_number));
			setcookie("password",md5($account_passoword));
			}
			header("Location: ?page=Account");
		}else{
			$wrong_password = "<p>Wrong password</p>\n";
		}
	}else{
	$account_dont_exist = "<p>Account dont exist</p>\n";
	}
}



echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
//Head
echo "<head>\n";
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\"/>\n";
echo "<meta name=\"description\" content=\"\"/>\n";
echo "<meta name=\"keywords\" content=\"\"/> \n";
echo "<meta name=\"author\" content=\"Oceanic\"/> \n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href="skins\style.css" media=\"screen\"/>\n";
echo "<title>".$title."</title>\n";
echo "</head>\n";

echo "<body>\n";
echo "<div id=\"wrapper\">\n";
echo "<div id=\"container\">\n";

echo "<div class=\"title\">\n";
	
echo "	<h1><a href=\"index.php\">".$title."</a></h1>\n";

echo "</div>\n";

echo "<div class=\"header\"></div>\n";

//Menu
echo "<div class=\"navigation\">\n";
echo "<a href=\"?page=Home\">Home</a>\n";
	if($_SESSION["logged_in"] == 1){
	echo "<a href=\"?page=Account\">Account</a>\n";
		if($_SESSION["admin"] == 1){
		echo "<a href=\"?page=Admin\">Admin</a>\n";
		}
	}else{
	echo "<a href=\"?page=Login\">Login</a>\n";
	}
	
echo "<a href=\"?page=Search\">Search</a>\n";
echo "<a href=\"?page=Highscore\">Highscore</a>\n";
echo "	<div class=\"clearer\"></div>\n";
echo "</div>\n";

//Main
echo "<div class=\"main\">\n";

echo "	<div class=\"content\">\n";
switch($_GET["page"]){

default:
	include "bin/news.php";
break;

case Home:
	include "bin/news.php";	
break;

case Comments:
	include "bin/comments.php";
break;


case Admin:
	include "bin/admin.php";
break;

case Login:
	include "bin/login.php";
break;

case Register:
	include "bin/register.php";
break;

case Search:
	include "bin/search.php";
break;

case Highscore:
	include "bin/highscore.php";	
break;

case Account:
	include "bin/account.php";
break;

case Logout:
	session_destroy();
	echo "<h3>Logout</h3>\n";
	echo "<h3>You was logged out, <a href=\"?page=Home\">Click here to go back</a></h3>\n";
break;

case Recover:
	include "bin/recover.php";
break;

}
echo "	</div>\n";


echo "	<div class=\"bottom\">\n";
echo "	<div class=\"clearer\"></div>\n";
echo "</div>\n";

//Footer
echo "	<div class=\"footer\">\n";
echo "	<div class=\"left\">\n";
echo "	Copyright &copy; 2008 <a href=\"http://kammarfelt.eu\">Oceanic</a>\n";
echo "	</div>\n";
echo "		<div class=\"right\">\n";
echo "			Website template based on by <a href=\"http://arcsin.se\">Arcsin</a>\n";
echo "		</div>\n";
echo "		<div class=\"clearer\"></div>\n";
echo "	</div>\n";
echo "</div>\n";

echo "</div>\n";
echo "</div>\n";

echo "</body>\n";
echo "</html>\n";
?>
 
Thank you Empty, although it wasn't the entire file. And no, a moderator does not have to approve it.
 
Yes, I had to approve his post for some reason, but it is done.
 
Really? Okay that's weird. Although I'll have a look at the code.

EDIT: Replace your entire code with this:
EDIT AGAIN: As I can't post, apparently a moderator has to approve it o.o, I've updated the code in this post.
PHP:
<?
/*
     Author: Oceanic
    Product Name: xCMS
    Purpose: To easy manage Opentibia servers, and to be a good CMS

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

session_start();
include "config.php";
error_reporting($error_reporting);
mysql_connect($connection[1], $connection[2], $connection[3]) or die("Could not connect, please check your settings");
mysql_select_db($connection[4]) or die("Database dont exist");

////////////////////////////////////
//    Search player
////////////////////////////////////

if(!empty($_POST["search_name"])){
    
    $name = mysql_escape_string($_POST["search_name"]);
    $player_check = mysql_query("SELECT * FROM players WHERE name='$name'") or die(mysql_error());
        if (mysql_num_rows($player_check) == 0){
        $player_dont_exist = "<p>Player dont exist</p>\n";
        }else{
        header("Location: ?page=Search&name=".preg_replace("/".chr(32)."/", "_", $_POST["search_name"]));
        }
}

////////////////////////////////////
//    Login
////////////////////////////////////

if(!empty($_POST["login_number"]) && !empty($_POST["login_password"])){
    
    $account_number = mysql_escape_string($_POST["login_number"]);
        if($use_md5 == true){
        $account_passoword = mysql_escape_string($_POST["login_password"]);
        $account_passoword = md5($account_passoword);
        }else{
        $account_passoword = mysql_escape_string($_POST["login_password"]);
        }
    

    
    if(!empty($_COOKIE["name"]) && !empty($_COOKIE["password"]) && $_POST["remember"] != true){
    setcookie("name","");
    setcookie("password","");
    }
    

    $get_account_data = mysql_query("SELECT * FROM accounts WHERE id='$account_number'") or die(mysql_error());
    
    if (mysql_num_rows($get_account_data) != 0){
        $data = mysql_fetch_array( $get_account_data );

        if($account_number == $data['id'] && $account_passoword == $data['password']){
            if($data['group_id'] > 1){
            $_SESSION["logged_in"] = 1;
            $_SESSION["admin"] = 1;
            $_SESSION["account_number"] = $account_number;
            
            }else{
            $_SESSION["logged_in"] = 1;
            $_SESSION["account_number"] = $account_number;
            }
            if($_POST["remember"] == true){
            setcookie("name",md5($account_number));
            setcookie("password",md5($account_passoword));
            }
            header("Location: ?page=Account");
        }else{
            $wrong_password = "<p>Wrong password</p>\n";
        }
    }else{
    $account_dont_exist = "<p>Account dont exist</p>\n";
    }
}



echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
//Head
echo "<head>\n";
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\"/>\n";
echo "<meta name=\"description\" content=\"\"/>\n";
echo "<meta name=\"keywords\" content=\"\"/> \n";
echo "<meta name=\"author\" content=\"Oceanic\"/> \n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"skinsstyle.css\" media=\"screen\"/>\n";
echo "<title>".$title."</title>\n";
echo "</head>\n";

echo "<body>\n";
echo "<div id=\"wrapper\">\n";
echo "<div id=\"container\">\n";

echo "<div class=\"title\">\n";
    
echo "    <h1><a href=\"index.php\">".$title."</a></h1>\n";

echo "</div>\n";

echo "<div class=\"header\"></div>\n";

//Menu
echo "<div class=\"navigation\">\n";
echo "<a href=\"?page=Home\">Home</a>\n";
    if($_SESSION["logged_in"] == 1){
    echo "<a href=\"?page=Account\">Account</a>\n";
        if($_SESSION["admin"] == 1){
        echo "<a href=\"?page=Admin\">Admin</a>\n";
        }
    }else{
    echo "<a href=\"?page=Login\">Login</a>\n";
    }
    
echo "<a href=\"?page=Search\">Search</a>\n";
echo "<a href=\"?page=Highscore\">Highscore</a>\n";
echo "    <div class=\"clearer\"></div>\n";
echo "</div>\n";

//Main
echo "<div class=\"main\">\n";

echo "    <div class=\"content\">\n";
switch($_GET["page"]){

default:
    include "bin/news.php";
break;

case "Home":
    include "bin/news.php";    
break;

case "Comments":
    include "bin/comments.php";
break;


case "Admin":
    include "bin/admin.php";
break;

case "Login":
    include "bin/login.php";
break;

case "Register":
    include "bin/register.php";
break;

case "Search":
    include "bin/search.php";
break;

case "Highscore":
    include "bin/highscore.php";    
break;

case "Account":
    include "bin/account.php";
break;

case "Logout":
    session_destroy();
    echo "<h3>Logout</h3>\n";
    echo "<h3>You was logged out, <a href=\"?page=Home\">Click here to go back</a></h3>\n";
break;

case "Recover":
    include "bin/recover.php";
break;

}
echo "    </div>\n";


echo "    <div class=\"bottom\">\n";
echo "    <div class=\"clearer\"></div>\n";
echo "</div>\n";

//Footer
echo "    <div class=\"footer\">\n";
echo "    <div class=\"left\">\n";
echo "    Copyright &copy; 2008 <a href=\"http://kammarfelt.eu\">Oceanic</a>\n";
echo "    </div>\n";
echo "        <div class=\"right\">\n";
echo "            Website template based on by <a href=\"http://arcsin.se\">Arcsin</a>\n";
echo "        </div>\n";
echo "        <div class=\"clearer\"></div>\n";
echo "    </div>\n";
echo "</div>\n";

echo "</div>\n";
echo "</div>\n";

echo "</body>\n";
echo "</html>\n";
?>
 
Last edited:
Try this..
PHP:
<?
/*
     Author: Oceanic
    Product Name: xCMS
    Purpose: To easy manage Opentibia servers, and to be a good CMS

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

session_start();
include "config.php";
error_reporting($error_reporting);
mysql_connect($connection[1], $connection[2], $connection[3]) or die("Could not connect, please check your settings");
mysql_select_db($connection[4]) or die("Database dont exist");

////////////////////////////////////
//    Search player
////////////////////////////////////

if(!empty($_POST["search_name"])){
    
    $name = mysql_escape_string($_POST["search_name"]);
    $player_check = mysql_query("SELECT * FROM players WHERE name='$name'") or die(mysql_error());
        if (mysql_num_rows($player_check) == 0){
        $player_dont_exist = "<p>Player dont exist</p>\n";
        }else{
        header("Location: ?page=Search&name=".preg_replace("/".chr(32)."/", "_", $_POST["search_name"]));
        }
}

////////////////////////////////////
//    Login
////////////////////////////////////

if(!empty($_POST["login_number"]) && !empty($_POST["login_password"])){
    
    $account_number = mysql_escape_string($_POST["login_number"]);
        if($use_md5 == true){
        $account_passoword = mysql_escape_string($_POST["login_password"]);
        $account_passoword = md5($account_passoword);
        }else{
        $account_passoword = mysql_escape_string($_POST["login_password"]);
        }
    

    
    if(!empty($_COOKIE["name"]) && !empty($_COOKIE["password"]) && $_POST["remember"] != true){
    setcookie("name","");
    setcookie("password","");
    }
    

    $get_account_data = mysql_query("SELECT * FROM accounts WHERE id='$account_number'") or die(mysql_error());
    
    if (mysql_num_rows($get_account_data) != 0){
        $data = mysql_fetch_array( $get_account_data );

        if($account_number == $data['id'] && $account_passoword == $data['password']){
            if($data['group_id'] > 1){
            $_SESSION["logged_in"] = 1;
            $_SESSION["admin"] = 1;
            $_SESSION["account_number"] = $account_number;
            
            }else{
            $_SESSION["logged_in"] = 1;
            $_SESSION["account_number"] = $account_number;
            }
            if($_POST["remember"] == true){
            setcookie("name",md5($account_number));
            setcookie("password",md5($account_passoword));
            }
            header("Location: ?page=Account");
        }else{
            $wrong_password = "<p>Wrong password</p>\n";
        }
    }else{
    $account_dont_exist = "<p>Account dont exist</p>\n";
    }
}



echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
//Head
echo "<head>\n";
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\"/>\n";
echo "<meta name=\"description\" content=\"\"/>\n";
echo "<meta name=\"keywords\" content=\"\"/> \n";
echo "<meta name=\"author\" content=\"Oceanic\"/> \n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"skinsstyle.css\" media=\"screen\"/>\n";
echo "<title>".$title."</title>\n";
echo "</head>\n";

echo "<body>\n";
echo "<div id=\"wrapper\">\n";
echo "<div id=\"container\">\n";

echo "<div class=\"title\">\n";
    
echo "    <h1><a href=\"index.php\">".$title."</a></h1>\n";

echo "</div>\n";

echo "<div class=\"header\"></div>\n";

//Menu
echo "<div class=\"navigation\">\n";
echo "<a href=\"?page=Home\">Home</a>\n";
    if($_SESSION["logged_in"] == 1){
    echo "<a href=\"?page=Account\">Account</a>\n";
        if($_SESSION["admin"] == 1){
        echo "<a href=\"?page=Admin\">Admin</a>\n";
        }
    }else{
    echo "<a href=\"?page=Login\">Login</a>\n";
    }
    
echo "<a href=\"?page=Search\">Search</a>\n";
echo "<a href=\"?page=Highscore\">Highscore</a>\n";
echo "    <div class=\"clearer\"></div>\n";
echo "</div>\n";

//Main
echo "<div class=\"main\">\n";

echo "    <div class=\"content\">\n";
switch($_GET["page"]){

default:
    include "bin/news.php";
break;

case "Home":
    include "bin/news.php";    
break;

case "Comments":
    include "bin/comments.php";
break;


case "Admin":
    include "bin/admin.php";
break;

case "Login":
    include "bin/login.php";
break;

case "Register":
    include "bin/register.php";
break;

case "Search":
    include "bin/search.php";
break;

case "Highscore":
    include "bin/highscore.php";    
break;

case "Account":
    include "bin/account.php";
break;

case "Logout":
    session_destroy();
    echo "<h3>Logout</h3>\n";
    echo "<h3>You was logged out, <a href=\"?page=Home\">Click here to go back</a></h3>\n";
break;

case "Recover":
    include "bin/recover.php";
break;

}
echo "    </div>\n";


echo "    <div class=\"bottom\">\n";
echo "    <div class=\"clearer\"></div>\n";
echo "</div>\n";

//Footer
echo "    <div class=\"footer\">\n";
echo "    <div class=\"left\">\n";
echo "    Copyright &copy; 2008 <a href=\"http://kammarfelt.eu\">Oceanic</a>\n";
echo "    </div>\n";
echo "        <div class=\"right\">\n";
echo "            Website template based on by <a href=\"http://arcsin.se\">Arcsin</a>\n";
echo "        </div>\n";
echo "        <div class=\"clearer\"></div>\n";
echo "    </div>\n";
echo "</div>\n";

echo "</div>\n";
echo "</div>\n";

echo "</body>\n";
echo "</html>\n";
?>
 
Status
Not open for further replies.
Back
Top