Просмотр файла view.php

Размер файла: 995B
<?php
//require('includes/header.php');
header("Content-type: text/vnd.wap.wml");
require('includes/utils.php');
require('includes/db.php');
require('includes/auth.php');

if(!isset($_GET['page']))
   $_GET['page'] = 'index.wml';

if(preg_match('/[^\w\.]/', $_GET['page']))
{
   echo '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">';
?>
<wml>
<card id="error" title="error" ontimer="main.php?id=<?php echo $id; ?>&amp;p=<?php echo $login; ?>"><timer value="15"/>
<p align="center">
Неправильное имя страницы
</p>
</card>
</wml>
<?php
   exit;
}

$contents = join('', file("$login/" . addslashes($_GET['page'])));
$contents = str_replace('</card>', '<p align="center"><br/>*********<br/>
<a href="edit.php?id=' . $id . '&amp;p=' . $login . '&amp;page=' . $_GET['page'] . '">Pe&#x0434;a&#x043A;&#x0442;op</a></p>' . "\n</card>", $contents);
echo $contents;
?>