


|
I've just found a mistake on your code, i've done it, but already fixed.
You're using short tags on the "html" side. Why don't you just use the "echo" or "print" to show up the website? |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title><?php echo $mainconfig['paneltitle']; ?> - RPanel</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="page">
<div id="header">
<div id="logo">
<img src="images/logo.png" alt="Logo" />
</div>
<div id="srvstatus">
<?php
if($sampQuery->isOnline()) {
$sinfos = $sampQuery->getInfo();
echo '<p class="srvon">' . $sinfos['players'] . '/' . $sinfos['maxplayers'] . ' Players</p>';
}
else {
echo '<p class="srvoff">Server off</p>';
}
?>
</div>
</div>
<div id="main">
<div id="menu">
<ul>
<li><a href="<?php echo $panelFunc->rewriteURL($mainconfig['urlrewrite'], 'index'); ?>">Home</a></li>
<li><a href="<?php echo $panelFunc->rewriteURL($mainconfig['urlrewrite'], 'stats'); ?>">Stats</a></li>
<li><a href="<?php echo $panelFunc->rewriteURL($mainconfig['urlrewrite'], 'rcon'); ?>">RCON</a></li>
<li><a href="<?php echo $panelFunc->rewriteURL($mainconfig['urlrewrite'], 'logs'); ?>">Logs</a></li>
<li><a href="<?php echo $panelFunc->rewriteURL($mainconfig['urlrewrite'], 'logout'); ?>">Disconnect</a></li>
</ul>
</div>
<div id="content">
<?php
if(!isset($_GET['p']))
$_GET['p'] = 'index';
if(!file_exists('pages/'.$_GET['p'].'.php'))
$_GET['p'] = '404';
include('pages/'.$_GET['p'].'.php');
?>
</div>
<div id="footer">
<p id="copy">RPanel - Designed and developped by <a href="http://rafael.keramid.as" target="_blank">Rafael Keramidas</a>.</p>
</div>
</div>
</div>
</body>
</html>
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>'.$mainconfig['paneltitle'];.' - RPanel</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="page">
<div id="header">
<div id="logo">
<img src="images/logo.png" alt="Logo" />
</div>
<div id="srvstatus">';
if($sampQuery->isOnline()) {
$sinfos = $sampQuery->getInfo();
echo '<p class="srvon">' . $sinfos['players'] . '/' . $sinfos['maxplayers'] . ' Players</p>';
}
else {
echo '<p class="srvoff">Server off</p>';
}
echo '
</div>
</div>
<div id="main">
<div id="menu">
<ul>
<li><a href="'.$panelFunc->rewriteURL($mainconfig['urlrewrite'], 'index');.'">Home</a></li>
<li><a href="'.$panelFunc->rewriteURL($mainconfig['urlrewrite'], 'stats');.'">Stats</a></li>
<li><a href="'.$panelFunc->rewriteURL($mainconfig['urlrewrite'], 'rcon');.'">RCON</a></li>
<li><a href="'.$panelFunc->rewriteURL($mainconfig['urlrewrite'], 'logs');.'">Logs</a></li>
<li><a href="'.$panelFunc->rewriteURL($mainconfig['urlrewrite'], 'logout');.'">Disconnect</a></li>
</ul>
</div>
<div id="content">';
if(!isset($_GET['p']))
$_GET['p'] = 'index';
if(!file_exists('pages/'.$_GET['p'].'.php'))
$_GET['p'] = '404';
include('pages/'.$_GET['p'].'.php');
echo '
</div>
<div id="footer">
<p id="copy">RPanel - Designed and developped by <a href="http://rafael.keramid.as" target="_blank">Rafael Keramidas</a>.</p>
</div>
</div>
</div>
</body>
</html>';
|
I prefer the way I used, the code is clearer and the result is the same (display and maybe a very small difference with the execution time).
|