Error Message -
Any Ideas?Warning: Cannot modify header information - headers already sent by (output started at /home/*******/public_html/writefile.php:6) in /home/********/public_html/writefile.php on line 30
Form -
Code: Select all
<HTML>
<BODY BGCOLOR=2222222>
<HEAD>
<TITLE>PCID Tool</TITLE>
</HEAD>
<BODY>
<center><a href="PCIDTool.php"><b><FONT COLOR="#ffffff">PCID Tool</Font></b></a> - <b><a href="http://thsquad.com"><FONT COLOR="#ffffff">Team Hate</FONT></a><b> - <a href="BL.php"><b><FONT COLOR="#ffffff">NovaWorld Banned List</FONT></a></b> - <b><a href="upload/"><b><FONT COLOR="#ffffff">Screen Shots</FONT></b></a></b></b></center><p>
<center><form method="post" action="writefile.php">
<TABLE style="background : #E0E0E0; border: solid 2pt #111111">
<TR>
<TD colspan='2' style="border-bottom: solid 1pt #666666; font-weight: bold; text-align: center">
User Data:
</TD>
</TR>
<TR>
<TD>
PCID:
</TD>
<TD>
<INPUT TYPE="TEXT" name="PCID:" size="10" maxlength="10" value=''>
</TD>
</TR>
<TR>
<TD>
Player Name:
</TD>
<TD>
<INPUT TYPE="TEXT" name="Gname:" size="20" maxlength="15" value=''>
</TD>
</TR>
<TR>
<TD>
Forum Name:
</TD>
<TD>
<INPUT TYPE="TEXT" name="Fname:" size="20" maxlength="15" value=''>
</TD>
</TR>
<TR>
<TD>
Other names:
</TD>
<TD>
<INPUT TYPE="TEXT" name="Onames:" size="20" maxlength="20" value=''>
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE="SUBMIT" value="Submit Search">
</TD>
</TR>
</TABLE>
</center>
</BODY>
</BODY BGCOLOR>
</HTML>Code: Select all
<HTML>
<HEAD>
<TITLE>Processing</TITLE>
</HEAD>
<BODY>
<?php
// FILENAME - writefile.php
if ($_POST['submit'] == "Submit") {
$dir = 'ID/';
$filename = "PCID01.php";
$content = $_POST['Gname:']." <br> ";
$content .= $_POST['Fname:']." <br> ";
$content .= $_POST['Onames:']."<br>";
$content .= $_POST['PCID:']."<br>____________________________________<br>";
if (!$handle = fopen($dir . $filename, "a+")) {
echo 'Unable to suscessfully open file.: ' . $filename;
exit;
}
if (!fwrite($handle, $content)) {
echo 'Unable to suscessfully write to file: ' . $filename;
exit;
}
echo 'Successfully added ID to Database, Click <a href="ID/PCID01.php">Here</a> to view database. ' . $filename;
} else {
header("Location: pcid.php");
}
?>
</BODY>
</HTML>