Forum Moderators: coopster
<?php
include('header.php');mysql_connect ('localhost', '', '') ;
mysql_select_db ('thunder_cms');
if (isset($_POST['update'])) {
$id = htmlspecialchars(strip_tags($_POST['id']));
$month = htmlspecialchars(strip_tags($_POST['month']));
$date = htmlspecialchars(strip_tags($_POST['date']));
$year = htmlspecialchars(strip_tags($_POST['year']));
$time = htmlspecialchars(strip_tags($_POST['time']));
$entry = $_POST['entry'];
$title = htmlspecialchars(strip_tags($_POST['title']));
if (isset($_POST['password'])) $password = htmlspecialchars(strip_tags($_POST['password']));
else $password = "";
$entry = nl2br($entry);
$category = (int)$_POST['category'];
if (!get_magic_quotes_gpc()) {
$title = addslashes($title);
$entry = addslashes($entry);
}
$timestamp = strtotime ($month . " " . $date . " " . $year . " " . $time);
$result = mysql_query("UPDATE php_blog SET timestamp='$timestamp', title='$title', entry='$entry', password='$password', category='$category' WHERE id='$id' LIMIT 1") or print ("Can't update entry.<br />" . mysql_error());
header("Location: /journal.php?id=" . $id);
}
[edited by: eelixduppy at 11:44 pm (utc) on Sep. 7, 2007]
[edit reason] removed specifics and code dump [/edit]
the error is
Warning: Cannot modify header information - headers already sent by (output started at /home/thunder/public_html/cms/admin/header.php:7) in /home/thunder/public_html/cms/admin/update.php on line 28