Reply
Does anyone know how I can make a mailing list thingy
Old 12-19-2008, 07:26 PM Does anyone know how I can make a mailing list thingy
Average Talker

Posts: 18
Location: California
Trades: 0
Hi Does anyone know how I can make a mailing list thing where I have a little form and say that I will offer them free information on music information,

and they enter their name and email address. What ends up happening? Does the email get stored in my hosting account? Or can someone tell me how it work and teach me how to do it?

Thanks.
__________________
Audio CD Mastering/Engineering
audiophd is offline
Reply With Quote
View Public Profile Visit audiophd's homepage!
 
 
When You Register, These Ads Go Away!
Old 12-19-2008, 08:06 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
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..
stevej is offline
Reply With Quote
View Public Profile
 
Old 12-19-2008, 08:13 PM Re: Does anyone know how I can make a mailing list thingy
Average Talker

Posts: 18
Location: California
Trades: 0
Hi Steve,

When you say incredibly insecure, what does this mean? People can hack into my websites?
__________________
Audio CD Mastering/Engineering
audiophd is offline
Reply With Quote
View Public Profile Visit audiophd's homepage!
 
Old 12-19-2008, 08:19 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
Well, they can just look at the text file and see the email addresses. But you could give your file a real complicated name, or even simpler, put your text file in a different directory and put a .htacess file in it.

- Steve

Last edited by stevej; 12-19-2008 at 08:35 PM..
stevej is offline
Reply With Quote
View Public Profile
 
Old 12-23-2008, 06:01 PM Re: Does anyone know how I can make a mailing list thingy
arudis's Avatar
Extreme Talker

Latest Blog Post:
Staff Positions Open
Posts: 199
Name: Henry
Location: Brooklyn
Trades: 0
How do I send emails out to everyone?
arudis is offline
Reply With Quote
View Public Profile Visit arudis's homepage!
 
Old 12-23-2008, 06:07 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
Just copy all the addresses in the .txt file and paste them into your BCC.
Simple, really.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 12-24-2008, 07:15 AM Re: Does anyone know how I can make a mailing list thingy
chrishirst's Avatar
Super Moderator

Posts: 22,285
Location: Blackpool. UK
Trades: 0
That won't work. Well it may work for a few addresses, but mail servers will limit you to either;
A limit to the number BCC recipients or a maximum of messages sent per hour.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-14-2009, 07:13 AM Re: Does anyone know how I can make a mailing list thingy
Experienced Talker

Posts: 32
Trades: 0
it didnt work...
rakoom2002 is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 12:43 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
Are you sure you are doing it right? Remember that you have to paste the php and html code into a seperate file, not the emails.txt file.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 04:17 AM Re: Does anyone know how I can make a mailing list thingy
Experienced Talker

Posts: 32
Trades: 0
It seems to be working on the website, okay, however when I go look at the txt file which it should be storing the information to, theres nothing there. I copied the php script to a .php file made a .txt for it to save the information to and then copied the html into my html code...

does the html code need to be referenced to the php file at all the link the two together?I know the php is linked to the txt file... I mean, how does the form know to use that specific php script. what if I had like three different php files in the same directory..
rakoom2002 is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 12:28 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
Oh. I'm sorry if the tutorial was a little unclear. The php code and the html code both go in the same page.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 04:38 PM Re: Does anyone know how I can make a mailing list thingy
Experienced Talker

Posts: 32
Trades: 0
so the php script has to be put in a .php file and pasted into the html for the website?
rakoom2002 is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 04:49 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
No, the php goes into whatever page you have your form on.
But that page will need to have a .php extension.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 04:50 PM Re: Does anyone know how I can make a mailing list thingy
Experienced Talker

Posts: 32
Trades: 0
sweet it worked. So Since I have the php pasted into the actual index.html along with the html is the .php file with the php script necessary?
rakoom2002 is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 04:56 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
No, that individual file is not necessary.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 05:01 PM Re: Does anyone know how I can make a mailing list thingy
Experienced Talker

Posts: 32
Trades: 0
Thank You Very Much Steve. One more quick question. There is a part of the php script that is called like success or something that prints "thank You for submitting email..." after the user has in fact submitted their email. Is there a way to style that, currently it is the same color as the background and aligned to the left of my apge. Lol I tried putting a < div> tag around the success text to style it with css and it FREAKED out.
rakoom2002 is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 05:06 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
Where is the code? That code is not in the script that I gave you. Could you please post it?

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 05:08 PM Re: Does anyone know how I can make a mailing list thingy
Experienced Talker

Posts: 32
Trades: 0
<?php
$filename = 'yourfile.txt'; //where to store data

if(isset($_POST['mail'])) {
$newcontent = htmlspecialchars(trim($_POST['mail']));
if(!empty($newcontent)) {
if (is_writable($filename)) {

if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $newcontent."\n") === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Thanks! You will be informed."; //success
fclose($handle);
} else {
echo 'Sorry, the file "' . $filename . '" is not writable';
}
}
}
?>
rakoom2002 is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 05:16 PM Re: Does anyone know how I can make a mailing list thingy
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
Oh... erm... that's actually Mad182's script from the last thread that you started. I guess can help you with it. I'm sure glad that you posted it because I thought you were tinkering around with my script. I guess I've been helping you in the dark.

Use something like '<span style="your styling here">Thanks! You will be informed.</span>'. My help is limited, because I am unfamiliar with this script and how it works.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Does anyone know how I can make a mailing list thingy
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.18911 seconds with 13 queries