Показать сообщение отдельно

  #9  
Старый 06.01.2010, 13:36
WNZRS
Участник форума
Регистрация: 03.09.2009
Сообщений: 179
С нами: 8782736

Репутация: 90
По умолчанию

Код:
<?php
//$html = file_get_contents('page.html');
$html = '<html>
 <head>
  <title>{TITLE}</title>
 </head>
   <body>
{CONTENT}
   </body>
</html>';

$title = 'Error 404';
$text = 'Page not found';
if(!isset($_GET['page']))
{
$title = 'Main page';
$text = 'Welcome to site';
}
else if($_GET['page'] == 'ip')
{
$title = 'View ip';
$text = 'Your ip: '.$_SERVER['REMOTE_ADDR'];
}

$html = str_replace('{TITLE}', $title, $html);
$html = str_replace('{CONTENT}', $text, $html);
echo $html;
?>
Почти шаблон..
 
Ответить с цитированием