Posted by Dave Kelly on 08/30/06 18:53
I would like to set up an online sign up sheet for club members to go on
a fishing trip.
I have googled and read so much this past week I am getting confused.
Using this code snippet:
===cut====
<body>
<?
if (isset($_POST["confirm"]))//posted?
{
//php must have write-access in this directory
$fp=fopen("data.txt","w");//overwrite existing text file
fwrite($fp,$_POST['name']));//write post-data
fclose($fp);
}
?>
<p>This is the sign up sheet for the South Padre Island Sandifer
Surffest</p><br clear="all"></p>
<form action='<?=$_SERVER["PHP_SELF"]?>' method="post">
Name <input type=text name=name size=40 maxlength=30>
Email <input type=text name=email address size=40 maxlength=40>
Phone <input type=text name=phone size=12 maxlenght=30>
<input type="submit" name="confirm">
</form>
</body>
===cut===
If I use this line:
<form action="confirm" method="post">
my FF browser window changed to the directory 'confirm' and clicking on
the 'data.txt' file shows nothing has happened.
If I use this line;
<form action='<?=$_SERVER["PHP_SELF"]?>' method="post">
I have this in my browser navigation box:
file:///root/My%20Documents/code/signup/%3C?=$_SERVER[%22PHP_SELF%22]?%3E
and a file not found error.
How do I get it to save the data that is entered?
I have been testing on my own system before uploading anything to the
web server.
Does anyone have a different direction for me to go. Perhaps a tutorial
that assumes I don't know what I am doing.
I feel like the guy that bought a bigger hard drive and downloaded the
internet. :(
TIA
Dave
[Back to original message]
|