Просмотр файла wapbuilder/editlinks.php

Размер файла: 2.26Kb
<?php
require('includes/header.php');
require('includes/utils.php');
require('includes/db.php');
require('includes/auth.php');

if(isset($_GET['action']) && $_GET['action'] == 'rename')
{
   mysql_query('UPDATE news SET text = "' . addslashes($_POST['text']) . '", date = CURRENT_TIMESTAMP WHERE id = "' . (int)$_GET['link_id'] . '"');
}
if(isset($_GET['action']) && $_GET['action'] == 'delete')
{
   mysql_query('DELETE FROM news WHERE id = "' . (int)$_GET['link_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
   exit;
}
?>
<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>
<?php
   $links_list = '';

   $links = mysql_query('SELECT id, text, date FROM news WHERE user_id = "' . (int)($_GET['id']) . '" AND id = "' . (int)$_GET['link_id'] . '"');

   if(($n = mysql_num_rows($links)) > 0)
   {
      $link = mysql_fetch_array($links, MYSQL_ASSOC);
   }
?>
<br/>
Название ссылки:<br/>
<input name="name" type="text" maxlength="20" value="<?php echo $link['name']; ?>" title="page"/><br/>
URL:<br/>
<input name="url" type="text" maxlength="20" value="<?php echo $link['url']; ?>" title="page"/><br/>
<anchor title="go">Ok<go href="editlinks.php?id=<?php echo $id; ?>&amp;p=<?php echo $login; ?>&amp;link_id=<?php echo $link['id']; ?>&amp;action=rename" method="post">
<postfield name="name" value="$(name)"/>
<postfield name="url" value="$(url)"/>
</go></anchor><br/>
*********<br/>
<a href="editlinks.php?id=<?php echo $id; ?>&amp;p=<?php echo $login; ?>&amp;link_id=<?php echo $link['id']; ?>&amp;action=delete">&#x0423;&#x0434;&#x0430;&#x043B;&#x0438;&#x0442;&#x044C;</a><br/>
*********<br/>
<a href="viewlinks.php?id=<?php echo $id; ?>&amp;p=<?php echo $login; ?>">&#x041A; &#x0441;&#x043F;&#x0438;&#x0441;&#x043A;&#x0443;</a><br/>
</p>
</card>
</wml>