Thanks ohdang888 for sharing your code,
So its just one .php file that i have to create with this code inside?
<?php
if (!isset($_POST['submit'])) {?>
<form method="post">
E-Mail:<input type="text" size="15" maxlength="30" name="email"/>
<input type="submit" name="submit" value="Submit"/>
<form>
<?php
} else {
$email = $_POST["email"];
$emailfile = "../emaillist.txt";
$FH = fopen($emailfile, 'a') or die("can't open file");
fwrite($FH,$email . ','); //LOOK AT THIS PART
fclose($FH);
}
?>
Or i have to separate the code in an html code and php...?
OH, and Northern Flame, isnt the same
<?php
//Add item to list if(isset($_POST['submit']) && $_POST['mailing_list_name'] != "" && $_POST['mailing_list_email'] != "") { $file_ptr = fopen("list.txt", "a+") or die("Couldn't create new file"); fwrite($file_ptr, $_POST['mailing_list_name'] . "\r\n"); fwrite($file_ptr, $_POST['mailing_list_email'] . "\r\n\r\n"); fclose($file_ptr); }
?>
Than
<?php
//Add item to list
if(isset($_POST['submit']) && $_POST['mailing_list_name'] != "" && $_POST['mailing_list_email'] != "") {
$file_ptr = fopen("list.txt", "a+") or die("Couldn't create new file");
fwrite($file_ptr, $_POST['mailing_list_name'] . "\r\n");
fwrite($file_ptr, $_POST['mailing_list_email'] . "\r\n\r\n");
fclose($file_ptr); }
?>
If it is not, i save that code in my subscribe.html, and change it to subscribe.php?
After i change it, i upload subscribe.php, createlists.php, and lists.txt (CHMOD 777)?