<?php
ob_start();
include("./root.txt");
$root = ob_get_contents();
ob_end_clean();
if ($userid)
{
if(isset($_POST["newtopic"]))
{
$f = $_POST["fid"];
$post = $_POST["reply"];
$topicname = $_POST["tname"];
$description = $_POST["tdesc"];
$replyFile = file ("$root/data/forum{$f}.txt");
foreach($replyfile as $reply) {
$replyparts = explode ("|", $reply);
$tid = trim($replyparts[0]);
$tid = $tid + 1
$postFile = fopen ("$root/data/forum{$f}.txt", "r+");
fwrite($postFile, "\n$tid|$topicname|$description|$post|$id|0|0|-
");
fclose($postFile);
header("Location: [url]http://[/url]".$HTTP_SERVER_VARS['HTTP_HOST']."/forums/index.php?act=rtopic&f={$f}&id={$tid}");
}
}
elseif ($userid == "NULL")
{
echo "<div align='center'>";
echo "<table border='1' cellspacing='0' width='158' height='36'>";
echo " <tr>";
echo " <td width='158' height='36'><p align='center'>Error: Not logged in!</td>";
echo " </tr>";
echo "</table>";
echo "</div>";
echo "</font>";
}
elseif (!$userid)
{
echo "<div align='center'>";
echo "<table border='1' cellspacing='0' width='158' height='36'>";
echo " <tr>";
echo " <td width='158' height='36'><p align='center'>Error: Not logged in!</td>";
echo " </tr>";
echo "</table>";
echo "</div>";
echo "</font>";
}
?>
Isn't liking the:
$postFile = fopen ("$root/data/forum{$f}.txt", "r+");
line...
But it does post $f, so it's something wrong with this script... >_<