Blah. I've been trying stuff for awhile, but I can't see why it doesn't work. It just won't fwrite to the file, and won't get {$f} for some reason. Can it not get variables like that from a string? I've done it before... :-/
Any help would be much appreciated.
Thanks,
xwin
<?php
ob_start();
include("./root.txt");
$root = ob_get_contents();
ob_end_clean();
if ($userid)
{
if(isset($_POST["addreply"]))
{
$f = $_POST["fid"];
$tid = $_POST["tid"];
$reply = $_POST["reply"];
$userFile = fopen ("../data/forum{$f}replies.txt", "a");
fwrite($userFile, "$tid|$reply|
");
fclose($userFile);
}
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>";
}
}
?>