Forms not save data

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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:


   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

<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">
&nbsp;Name <input type=text  name=name size=40  maxlength=30>
&nbsp;Email <input type=text name=email address size=40 maxlength=40>
&nbsp;Phone <input type=text name=phone size=12 maxlenght=30>
<input type="submit" name="confirm">

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:
and a file not found error.

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. :(


Re: Forms not save data

Dave Kelly wrote:
 > <web stuff snipped>

You seem to have wandered into the wrong newsgroup.  This has
nothing to do with any of the UNIX command shells.  Perhaps
you wanted comp.infosystems.www.authoring.cgi.

Re: Forms not save data

On 2006-08-30, Dave Kelly wrote:
Quoted text here. Click to load it

   This is PHP, not a shell script. If you really want to use PHP,
   post it to a PHP newsgroup.

Quoted text here. Click to load it

   As I told you in another group, I'd use a shell script. Have a look
   at this form and the CGI script that processes it:
   < (form)
   < (CGI script)
   < (style sheet)

   The script needs more, but it works as is.

   Chris F.A. Johnson, author              <
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
   ===== My code in this post, if any, assumes the POSIX locale
   ===== and is released under the GNU General Public Licence

Re: Forms not save data

Chris F.A. Johnson wrote:
Quoted text here. Click to load it

I'd use Perl myself... but I guess everybody's got a favorite scripting


Re: Forms not save data

In alt.html, Dave Kelly wrote:

Quoted text here. Click to load it

Do you have PHP installed on your computer?  If not, the script won't
run, of course.  (Yeah, I know that is a basic question, but you didn't
say ... <g>)

   -Motorcycles defy gravity; cars just suck.

Site Timeline