You are here: Forms not save data « HTML « IT news, forums, messages
Forms not save data

Posted by Dave Kelly on 08/30/06 18:55

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">
&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">
</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.

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация