Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Email Newsletter Help?

Featured Replies

Hello!

 

I'm trying to set up a newsletter form. Do I set up like how you would set up a contact form? I'm using dreamweaver cs5. I want my form to send it to some excel sheet so if I have a lot of subscriptions, it will be easier for me to email people. How do popular websites set up a newsletter form? I'm fairly new and I'm just touching the surface of web designing.

 

Thank you!

Hello!

 

I'm trying to set up a newsletter form. Do I set up like how you would set up a contact form? I'm using dreamweaver cs5. I want my form to send it to some excel sheet so if I have a lot of subscriptions, it will be easier for me to email people. How do popular websites set up a newsletter form? I'm fairly new and I'm just touching the surface of web designing.

 

Thank you!

 

Mmmm nah thats really far from how u do it you will need to know Php and mysql beable to accept email addresses and allow people to unsubscribe and subscribe not only that u will need to store the info in a mysql database and also build a mailing system where you can email all the subscribers at once and this should prob be in some type of admin panel where you login to :) Hope this gave you some idea

  • Author

Thanks! I was wondering if you have a good resource for me to learn how to build one? I'm building a website and I want people to submit their email address. Any good tutorials will probably be great!

 

Thank you :)

There's no need for a database to do this. You can easily write data to an excel speadsheet, or even easier a simple text file.

 

Yes it can be done this way but why not just use a mysql database thats what mysql is there for. :)

This code isn't tested but it should give you a rough idea how easy it is to write post variables from a form into a CSV file using PHP.

 

if(isset($_POST['submit'])) {

$member = array (
	filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING),
	filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL),		
);

if(filter_var($member[1], FILTER_VALIDATE_EMAIL)) {
	$fp = fopen('newsletter.csv', 'w');

	fputcsv($fp, implode(',',$member));
	fclose($fp);
}
}

 

Also, have you thought about using a hosted service such as campaign monitor or mailchimp instead? They offer easy integration with most common CMS systems and they have tutorials on how to integrate user signup's.

 

Edit: Also worth a mention is PEAR's excel writer - http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.intro.php

  • Author

I was thinking about those services, but right now I'm not trying to spend any money because I'm not sure how far my website go.

 

But I'm trying to use this module from this website: http://net.tutsplus.com/freebies/others/fantastic-ajax-newsletter-module/

 

But I'm having a little trouble setting my form up where this module can receive the email addresses.

 

Anyone have any ideas?

 

my form code

<form action="/subscription.php" method="post" enctype="text/plain" class="subscription_box" onsubmit="MM_validateForm('subscription_email','','NisEmail');return document.MM_returnValue">

     <input name="subscription_email" type="text" id="subscription_email" value="insert email, then press enter." size="40" maxlength="64" onfocus="if(this.value=='insert email, then press enter.'){this.value='';}" onblur="if(this.value==''){this.value='insert email, then press enter.';}"/>

 <label for="subscription_email"></label>
 </form>

 

The module came with a index.php file, but I changed it to subscription.php. But I don't think I'm supposed to put the file in the action because when I tried submitting the form, it goes straight to the module, which I don't want. When I submit the form, I wanted to have a response, saying thank you or something under the form and then the email could be sent to my module.

 

Thanks for the help guys!

  • Author

I've gone a new approach. I used this script: http://www.knowledgesutra.com/forums/topic/25586-php-simple-newsletter-script/

 

But does anyone know how to link the module to the script of what I have now

 

form script

  <form action="mailing.php" method="post" enctype="text/plain" class="subscription_box" onsubmit="MM_validateForm('subscription_email','','NisEmail');return document.MM_returnValue">

     <input name="subscription_email" type="text" id="subscription_email" value="insert email, then press enter." size="40" maxlength="64" onfocus="if(this.value=='insert email, then press enter.'){this.value='';}" onblur="if(this.value==''){this.value='insert email, then press enter.';}" onSubmit="return submitenter(this,event)"/>

 <label for="subscription_email"></label>
 </form>

 

But I don't want to use the script for when they send out a message. I would like to use the module, but I'm not sure how to link the module to what I have set up already.

 

Any suggestions?

 

Thanks


<?php
//mailing.php
if(isset($_POST['subscription_email'])) {                           
   if($email = filter_input(INPUT_POST, 'subscription_email', FILTER_VALIDATE_EMAIL)) {
       $file = fopen("mailing.txt", "a");
       fwrite($file, "\n" . $email);
       fclose($file);

       header("Location: mailing_thankyou.php");
   }
}

Sorry, what does that code do? I'm not good in php :(

 

Thank you for responding

 

checks that the email address has been entered and is set, then writes the email to a text file and redirects the person to a thank you page.

You could try www.phplist.com. It's free to download and relatively easy to use.

There's no need for a database to do this. You can easily write data to an excel speadsheet, or even easier a simple text file.

 

Are you kidding me? 10,000 email address and 5,000 trying to access the excel at the same time! Your asking for trouble...

  • Author

Thanks for the reply, I checked out phpList, but it seems to complicated for me right now. I've already set up my site with the necessity of having a form. But I'm just not sure why when I tried testing my site by inputing an email in the form, it doesn't go into my .txt file?

 

Or if anyone has dealt with this newsletter module: http://net.tutsplus.com/freebies/others/fantastic-ajax-newsletter-module/

 

How would I integrate it with my set up?

 

Thanks

Why are ypou asking for trouble? Yes, if 5000 writes were attempted at once (which is very very unlikely) you at some point get a slowdown/failed writes but that wouldn't be on a lot of records. Also, not sure where you got those figures from too?

 

Saying 'I'm asking for trouble' using a method other than mysql is fine in practice, but not every client/host/project has scope for a mysql database. Sometimes, you haven't always got an ideal setup to be working on.

 

Hey i did not mean to sound like i was picking a fight with u or anything hope u did not think i was everyone has there own oppions i guess :) No hard feelings i hope :)

Why are ypou asking for trouble? Yes, if 5000 writes were attempted at once (which is very very unlikely) you at some point get a slowdown/failed writes but that wouldn't be on a lot of records. Also, not sure where you got those figures from too?

 

Saying 'I'm asking for trouble' using a method other than mysql is fine in practice, but not every client/host/project has scope for a mysql database. Sometimes, you haven't always got an ideal setup to be working on.

 

Yes, The figures? Its called thinking ahead... its like saying "I have a bugatti veyron its nice and confy it does everything its asked to and does it well, But instead im going to take the less reliable car instead"

 

Why????? If MYSQL is there take advantage of it lol, If this guys site is populer or gets populer? Its not going to look to clever in the long run..

 

(BTW im not having ago Just saying :p)

  • Author

How do I work with mysql? I have WAMP and I think it has mysql on it too where I can locally test my site correct? How do i go about completing my form with this kind of setup? Do I need to show you anything?

 

Thanks for all the inputs.

How do I work with mysql? I have WAMP and I think it has mysql on it too where I can locally test my site correct? How do i go about completing my form with this kind of setup? Do I need to show you anything?

 

Thanks for all the inputs.

 

Well those so much to explain about mysql and creating a secure mailing list i think google prob is ur best friend right now :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.