Kod
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache/www/htdocs/grodzicki.com/html/Tjablonski/napisz.php:9) in /usr/local/apache/www/htdocs/grodzicki.com/html/Tjablonski/napisz.php on line 58
a skrypt wygląda tak:
[php:1:81a0b6f777]<?php
include('config.php');
if ($forum_logged=="true") {
if (!isset($submit)) { ?>
<form action="napisz.php" method="post">
<table align="center">
<tr>
<td>temat: </td>
<td><input type="text" name="topic" style="width: 400px"></td>
</tr>
<tr>
<td>tre¶ć: </td>
<td><textarea name="text" rows="20" style="width: 400px"></textarea></td>
</tr>
<tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="Wy¶lij"></td>
</tr>
</table>
</form>
<?php }
else {
if (($topic==null) || ($text==null)) {
header("location:error.php?104");
exit;
} else {
$topic=strip_tags($topic);
$text=str_replace("n", "<br>", $text);
$text=strip_tags($text,"<b><u><i><br>");
$topic=addslashes($topic);
$text=addslashes($text);
$q="select max(id) from nexis_posts";
$d=mysql_query($q);
$r=mysql_fetch_array($d);
$max=$r[0];
$max++;
$today=date("d.m.y");
$q="insert into nexis_reply values ('$max','1','$forum_user','$today',curtime(),'$text')";
mysql_query($q);
$q="insert into nexis_posts values ('$max','$topic','$forum_user','$forum_user','$today',curtime())";
mysql_query($q);
$q="update nexis_users set posts=posts+1 where login='$forum_user'";
mysql_query($q);
header("location:watek.php?id=$max");
exit;
}
}
} else {
header("location:loguj.php");
exit;
}
?>[/php:1:81a0b6f777]