<?php
$postnum = $POST['postnum'];
$mrid = $POST['mrid'];
$postperc = $POST['postperc'];
$launchdate = $POST['launchdate'];
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
?>
<html>
<body>
<?php
$outputstring = $mrid."\t"."\t"."\t".$launchdate."\n"."\n"."\n"."Posted \t\t".$postnum."\t"."\t"."\t".$postperc."\n";
@ $fp = fopen("$DOCUMENT_ROOT/../folder/text.txt", 'a+');
if (!@fp)
{
echo '<p><strong>There was an error, Please try again</strong></p>';
exit;
}
fwrite($fp, $outputstring, strlen($outputstring));
fclose($fp);
echo '<p>Added Successfully</p>';
?>
I have this on my ftp site which is essentially running apache and php.
file path is ~/public_html/folder/text.txt
am i referencing the text file correctly?