View file addnews.php

File size: 1.21Kb
<?php
require('includes/header.php');
require('includes/utils.php');
require('includes/db.php');
require('includes/auth.php');
if(isset($_POST['text']))
{
   mysql_query('INSERT INTO news(text, date, user_id) VALUES ("' . addslashes($_POST['text']) . '", CURRENT_TIMESTAMP, "' . (int)$id . '")');
?>
<wml>
<card id="added" title="added" ontimer="viewnews.php?id=<?php echo $id; ?>&amp;p=<?php echo $login; ?>"><timer value="15"/>
<p>
Новость добавлена<br/>
</p>
</card>
</wml>
<?php
}
else
{
?>
<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="links" title="&#x041C;&#x0435;&#x043D;&#x0435;&#x0434;&#x0436;&#x0435;&#x0440; &#x0444;&#x0430;&#x0439;&#x043B;&#x043E;&#x0432;">
<do type="options" name="main" label="&#x041C;&#x0435;&#x043D;&#x044E;"><go href="main.php?id=<?php echo $id; ?>&amp;p=<?php echo $login; ?>"/></do>
<p>
Текст новости:<br/>
<input name="text" maxlength="255" title="text"/><br/>
<anchor title="go">OK<go href="addnews.php?id=<?php echo $id; ?>&amp;p=<?php echo $login; ?>" method="post">
<postfield name="text" value="$(text)"/>
</go></anchor><br/>
</p>
<p align="center">
</p>
</card>
</wml>
<?php
}
?>