index.php:
<?php
include('headers.php');
include('style/topleft.php');
if (isset($_GET[id
])) $id=$_GET[id
]; else $id='';
switch ($id) {
case 'news': include('style/news.php'); break;
case 'contact': include('style/contact.php'); break;
case 'wars': include('style/wars.php'); break;
case 'presence': include('style/presence.php'); break;
case 'recruit': include('style/recruit.php'); break;
case 'members': include('style/members.php'); break;
case 'regulamin': include('style/regulamin.php'); break;
case 'stats': include('style/stats.php'); break;
case 'download': include('style/download.php'); break;
case 'panel': include('style/panel.php'); break;
case 'login': include('style/login.php'); break;
case 'register': include('style/register.php'); break;
default: include ('style/news.php');
}
include ('style/rightbottom.php');
?>
headers.php:
<?php
function gettime(){
list
($mikrosek, $sek)=explode(\" \", microtime()); return ((float)$mikrosek + (float)$sek);
}
$start = gettime();
header(\"Content-Type: text/html; charset=ISO-8859-2\"); $res = mysql_query(\"SELECT * FROM `config` where id='password'\"); $pass=\"$wrs[content]\";
}
function form()
{
echo \"<form method='POST' action='index.php?id=login'>\"; echo \"Login: <input type='text' name='login' size='7'><br>\"; echo \"Hasło: <input type='password' name='pass' size='7'><br>\"; echo \"<input type='hidden' name='from' value='\". $_SERVER['PHP_SELF'] .\"'>\"; echo \"<input type='submit' value='ok'></form>\"; echo \"<a href='index.php?id=register'>Zarejestruj się</a>\"; }
?>
W style/topleft.php jest lewe menu. Nie ma kodu php
W style/rightbottom.php jest prawe menu. Znajduje się tam wywołanie funkcji gettime().
W style/panel.php jest tylko kod html.
To był wstęp (IMG:
http://forum.php.pl/style_emoticons/default/aaevil.gif)
Przy $id="panel" wyskakuje błąd: Fatal error: Cannot redeclare gettime() (previously declared in /usr/export/www/vhosts/funnetwork/hosting/pts1939/headers.php:3) in /usr/export/www/vhosts/funnetwork/hosting/pts1939/headers.php on line 2