CODE
<form id="form1" name="form1" method="post" action="">
<form action="/email.php" method="post">
<label for="email">Email:</label>
<input name="email" type="text" id="email" size="40">
<input type="submit" value="Inform Me!" />
<label for="lastname"></label>
</form> </form>
<form action="/email.php" method="post">
<label for="email">Email:</label>
<input name="email" type="text" id="email" size="40">
<input type="submit" value="Inform Me!" />
<label for="lastname"></label>
</form> </form>
This is the HTML form you put on your website where you want the box to be displayed.
Create a file named email.php and place this code in it:
CODE
<?php
$filename = "emails-4214.txt"; #you gotta chmod this to 666
$text = $_POST['email'];
$fp = fopen ($filename, "w"); # you don't have to make the .txt file, this line will do it for you id you don't already have it
if ($fp) {
fwrite ($fp, $text);
fclose ($fp);
echo ("Gratzi for teh emailz!"); #change the txt to what you want it to say when they submit the form
}
else {
echo ("Oh Noes! You Broke my ******* site!"); #Change the text to what you want it to say in the rare occurance that there's an error :o
}
?>
$filename = "emails-4214.txt"; #you gotta chmod this to 666
$text = $_POST['email'];
$fp = fopen ($filename, "w"); # you don't have to make the .txt file, this line will do it for you id you don't already have it
if ($fp) {
fwrite ($fp, $text);
fclose ($fp);
echo ("Gratzi for teh emailz!"); #change the txt to what you want it to say when they submit the form
}
else {
echo ("Oh Noes! You Broke my ******* site!"); #Change the text to what you want it to say in the rare occurance that there's an error :o
}
?>
Place this code in the file called emails.php and upload it to the server, after that submit the first email and the file will be created. Pretty simple little script.. You can check out a demo of it @ www.yozoe.com
C
This post has been edited by -Gareth: 28 January 2009 - 03:51 PM
Reason for edit: No swearing, please.

Sign In
Register
Help


MultiQuote

