I can't submit any data into a text file, in a lower directory, using forms, and the 'fputs' function in php. I removed the javascript alert that I had. Letting me know every thing worked out ok. Even though it claims the information has been submitted, nothing shows up in the text file. Here's my code:
<?php
$out = fopen("rs/xpdb/fishingxp.txt", "a");
if (!$out) {
print("Could not append to file, please contact blah blah");
exit;
}
fputs($out,"<td align=left valign=top bgcolor=#000000><font size=1 color=#FFFFFF><b>\n");
fputs($out,"$skill\t");
fputs($out,"</b></font></td>\n");
fputs($out,"<td align=left valign=top bgcolor=#000000><font size=1 color=#FFFFFF><b>\n");
fputs($out,"$xp\t");
fputs($out,"</b></font></td>\n");
fputs($out,"<td align=left valign=top bgcolor=#000000><font size=1 color=#FFFFFF><b>\n");
fputs($out,"$level\t");
fputs($out,"</b></font></td>\n");
fputs($out,"<td align=left valign=top bgcolor=#000000><font size=1 color=#FFFFFF><b>\n");
fputs($out,"$bored\t");
fclose($out);
?>
I've even removed all "table tags" from the code, and left it bare. I've checked the submission forms (form method="post" action="rs/fishxp.php"). I get no errors at all. I've set diretory and file permissions:
Folder -> xpdb (permissions - 777)
File -> fishingxp.txt (permissions - 777)
I'm using the 'include' function to display everything in "rs/xpdb/fishingxp.txt", which I've checked. But, I can't even get anything submitted into the text file at all.
Here's the file I'm using to submit into the php script, then onto the txt file itself. It's in the above directory. I've checked all paths, which are correct.
<table width="50%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" valign="middle">
<font size="1"><b>Fishing Skill:</b></font></tD>
<td align="center" valign="middle">
<form method="post" action="rs/fishxp.php">
<INPUT TYPE="TEXT" NAME="skill" size="25"></td></tr>
<tr>
<td align="left" valign="middle">
<font size="1"><b>XP Given:</b></font></td>
<td align="center" valign="middle">
<INPUT TYPE="TEXT" NAME="xp" size="25"></tR></td>
<tr>
<td align="left" valign="middle">
<font size="1"><b>Level Required:</b></font></td>
<td align="center" valign="middle">
<INPUT TYPE="TEXT" NAME="level" size="25"></tR></td>
<tr>
<td align="left" valign="middle">
<font size="1"><b>Level Required:</b></font></td>
<td align="center" valign="middle">
<INPUT TYPE="TEXT" NAME="bored" size="25"></tR></td>
<Tr>
<td align="left" valign="middle">
<font size="1"><b>Submit:</b></font></td>
<td align="center" valign="middle">
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Submit Post"> <INPUT TYPE="RESET" NAME="Reset" VALUE="Clear Fields">
</form>
</tR></td></table>
Any ideas on what I'm doing wrong?