20.05.2012, 21:40
i mean this:
You can do all on php, with echo or print.
like:
*** not tested.
I'm currently using like this on my php jobs, less <?php ?> and don't have short tags.
PHP код:
<!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>
like:
PHP код:
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'm currently using like this on my php jobs, less <?php ?> and don't have short tags.