deleted user 111213 Grandmaster Cheater Reputation: 0
Joined: 09 Nov 2007 Posts: 714
Posted: Sun Feb 15, 2009 3:01 pm Post subject: problem[PHP]
Code:
<?php
if (!$_POST['submit']) {
echo "Invalid Usage of file!\n";
} else {
$tid = $_GET['id'];
$msg = $_POST['reply'];
if (!$tid) {
echo "You did not supply a topic to reply to!\n";
} else {
$sql = "SELECT * FROM forum_topics WHERE id='$tid'";
$res = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($res) == 0) {
echo "This topic does not exist!\n";
} else {
$row = mysql_fetch_assoc($res);
$sql2 = "SELECT admin FROM forum_sub_cats WHERE id='{$row['cid']}'";
$res2 = mysql_query($sql2) or die(mysql_error());
$row2 = mysql_fetch_assoc($res2);
if ($row2['admin'] == 1 && $admin_user_level == 0) {
echo "You cannot post here, this is because you are not an admin!\n";
} else {
if (!$msg) {
echo "You did not supply a message for the reply!\n";
} else {
if (strlen($msg) < 10 || strlen($msg) > 500) {
echo "Your reply must be between 10 and 500 characters!\n";
} else {
$date = date("m-d-y") . " at " . date("h:i:s");
$time = time();
$sql3 = "INSERT INTO `forum_replies` (`tid`,`uid`,`message`,`date`,`time`) VALUES('" .
$tid . "','" . $_SESSION['uid'] . "','" . $msg . "','" . $date . "','" . $time .
"')";
$res3 = mysql_query($sql3) or die(mysql_error());
$sql4 = "UPDATE `forum_topics` SET `time`='" . time() . "' WHERE `id`='" . $tid . "'";
$res4 = mysql_query($sql4) or die(mysql_error());
header("Location: index.php?act=topic&id=" . $tid);
}
}
}
}
}
}
?>
it gives me the error
Quote:
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/matt/public_html/forum/index.php:16) in /usr/home/matt/public_html/forum/includes/reply.php on line 38
maybe you should read this but i can see your problem right off the bat ;]
as per this quote
Quote:
It is important to notice that header() must be called before any actual output is sent (In PHP 4 and later, you can use output buffering to solve this problem):
ps i dont know php ;p
regards BanMe _________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum