The following code:
for a post/editing script does not work. The posting is fine, but editing does not work at all. The following code is used on the editing page to check if we're editing a post, and if so provide necessary information.PHP Code:<?php } else {
if (isset($_GET['go'])) {
$name=filter_html($_POST['name']);
$auth=filter_html($_POST['auth']);
$desc=filter_html($_POST['elm4']);
if (isset($_POST['updater']))
{
mysql_query("DELETE FROM `posts` WHERE `id`='$_GET[updater]'");
mysql_query("INSERT INTO `posts` (`id`,`name`,`date`,`author`,`desc`) VALUES ('$_POST[updater]','$name',$_POST[thedate],'$auth','$desc');");
}
else
mysql_query("INSERT INTO `posts` (`name`,`date`,`author`,`desc`) VALUES ('$name',NOW(),'$auth','$desc');");
}?>
The MySQL query does not make any errors, and it is executed, but the edits do not appear.PHP Code:<?php if ($_GET['add']) echo '<input type="hidden" name="updater" value="'.$data['id'].'"><input type="hidden" name="thedate" value="'.$data['date'].'">';?>



Reply With Quote





Bookmarks