Hi All,
I'm new to the forum and pretty green with PHP (SQL guy trying to learn).
Anyway, I decided to write a script that would allow people to sign up for a notification on my website. I want to put single field form on my page to collect the email address and dump that address into a test file on my server (adding each new address to that same file). I can't, however, for the life of me get the data to write to that file. I have checked all the CHMOD settings (set to 777 on both the form page and process page). Plus, I wrote another script to to write non form data to that same file- that worked. My scripts are below, any help would be appreciated.
[FORM]
[code=html]<html>
<body>
<form action="contact .php" method="post">
Email: <input type="text" email="email" />
<input type="submit" />
</form>
</body>
</html>[/code]
[PROCESS PAGE]
[code=php]<?PHP
$filename = "contact.tx t";
$text = $_POST['email'];
$fp = fopen ($filename, "a");
if ($fp) {
fwrite ($fp, $text);
fclose ($fp);
?>[/code]
Thanks,
Jake
I'm new to the forum and pretty green with PHP (SQL guy trying to learn).
Anyway, I decided to write a script that would allow people to sign up for a notification on my website. I want to put single field form on my page to collect the email address and dump that address into a test file on my server (adding each new address to that same file). I can't, however, for the life of me get the data to write to that file. I have checked all the CHMOD settings (set to 777 on both the form page and process page). Plus, I wrote another script to to write non form data to that same file- that worked. My scripts are below, any help would be appreciated.
[FORM]
[code=html]<html>
<body>
<form action="contact .php" method="post">
Email: <input type="text" email="email" />
<input type="submit" />
</form>
</body>
</html>[/code]
[PROCESS PAGE]
[code=php]<?PHP
$filename = "contact.tx t";
$text = $_POST['email'];
$fp = fopen ($filename, "a");
if ($fp) {
fwrite ($fp, $text);
fclose ($fp);
?>[/code]
Thanks,
Jake
Comment