Posts: 991
Location: In a flying house
|
Sure. You can use a simple little form, and when a user enters in their info, it gets sent to a text file with proper formatting and everything.
Pros: - Short
- Simple
- Easy to modify
Cons: - Incredibly insecure (that can be changed, though)
Create a .txt file and name it "emails.txt".
And then paste this code into a file: (has to be a .php file for it to work)
PHP Code:
<?php $database = "emails.txt"; $file = fopen($database, "a+"); $size = filesize($database); $name = $_POST['name']; $email = $_POST['email']; if($_POST['submit']) fwrite($file, "\"$name\" <$email>,"); ?>
HTML Code:
<form method="post">
Name: <input type="text" name="name" size="20"><br />
Email: <input type="text" name="email" size="20"><br /><br />
<input type="submit" value="Subscribe" name="submit">
</form>
As I said, it is incredibly insecure. If you wanted to get a secure one, you would want to use a MySQL database.
Tell me if it works out for you!
- Steve
Last edited by stevej; 12-19-2008 at 09:18 PM..
|