Roar!
01-30-2007, 12:49 AM
I've been trying and I think I'm just about there. Except I'm stuck.
<
<form name="carpool" action="submit.php" method="post">
Check the days that you are able to drive <b>TO</b> rowing.<p>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Monday"> Monday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Tuesday"> Tuesday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Thursday">Thursday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Friday">Friday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Saturday">Saturday</LABEL>
</p>
Check the days that you are able to drive <b>FROM</b> rowing.<p>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Monday"> Monday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Tuesday"> Tuesday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Thursday">Thursday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Friday">Friday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Saturday">Saturday</LABEL>
</p>
<input type="submit" name="submit" value="el submito" />
There is my form. When I click the submit button, It wants to download my submit.php file. Not what I want. I just watn to save the results to a text file on my computer.
Here's my php file:
<?php
$day = $_POST['day'];
if(!$day)
{
echo "Please submit some days";
exit;
}
else
{
$filename = "carpool.txt";
$content = "$day\n";
$fp = fopen($filename, "a");
$fw = fwrite( $fp, $content );
fclose( $fp );
if(!$fw) echo "You made a mistake, try again or ill kill you or something.";
else echo "Successfully submitted.";
}
?>
I've also got a text file named carpool.txt
Thanks for reading and extra thanks if you help. :)
<
<form name="carpool" action="submit.php" method="post">
Check the days that you are able to drive <b>TO</b> rowing.<p>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Monday"> Monday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Tuesday"> Tuesday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Thursday">Thursday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Friday">Friday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Saturday">Saturday</LABEL>
</p>
Check the days that you are able to drive <b>FROM</b> rowing.<p>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Monday"> Monday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Tuesday"> Tuesday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Thursday">Thursday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Friday">Friday</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="day" VALUE="Saturday">Saturday</LABEL>
</p>
<input type="submit" name="submit" value="el submito" />
There is my form. When I click the submit button, It wants to download my submit.php file. Not what I want. I just watn to save the results to a text file on my computer.
Here's my php file:
<?php
$day = $_POST['day'];
if(!$day)
{
echo "Please submit some days";
exit;
}
else
{
$filename = "carpool.txt";
$content = "$day\n";
$fp = fopen($filename, "a");
$fw = fwrite( $fp, $content );
fclose( $fp );
if(!$fw) echo "You made a mistake, try again or ill kill you or something.";
else echo "Successfully submitted.";
}
?>
I've also got a text file named carpool.txt
Thanks for reading and extra thanks if you help. :)