NaN:NaN
NaN:NaN
--:-- / --:--
Newgrounds Background Image Theme

PurpleNightmaren just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Newsletter Subscription

598 Views | 2 Replies
New Topic Respond to this Topic

I had made a website for a friend of mine and he has had it for awhile but he has decided to now have a newsletter for the site.
Originally he tried himself with google groups, but he wanted pictures etc so the newsletter would look good.
So i got this software which would allow me to just make the template in html and then have all the subscribers, but the problem is i would have to type in each email manually. Instead i would prefer to have a subscription button....originally he had asked me to mess around with the google one they give you.
So i already have that, i just want to alter the form and the input so that when someone inputs their email, it would be printed somewhere, on a file, anywhere. and all the emails would be on the file, so that i could just look at the file, Copy and Paste all the emails , voila. Perfect. Does anyone know how to do this or if it is possible?


BBS Signature

Response to Newsletter Subscription Mar 23, 2006


The nightly mails from Newgrounds go out to well over a quarter of a million people every night, half a million go on Wednesday night, and they're all formatted in HTML (although I'm debating as to whether or not to make that an option, so users who aren't able to receive HTML mails don't).

So, it's perfectly possible and there are already plenty of pre-written scripts out there that will allow you to do it, dependant on what software you have access to on the server that the site runs on and / or whether you have sufficient privileges on the server you're running from to install whatever software you want on there.

You're going to have to be much more specific as to your needs if anyone here is going to help you. If you just have a few subscribers, then this could be a really simple set of scripts and, as I already said, there are plenty of scripts out there that you could probably grab - and then hack to suit your own needs, dependant on the terms of you using those scripts as specified by their creators, that is.

Response to Newsletter Subscription Mar 25, 2006


At 3/23/06 07:40 PM, liljim wrote: The nightly mails from Newgrounds go out to well over a quarter of a million people every night, half a million go on Wednesday night, and they're all formatted in HTML (although I'm debating as to whether or not to make that an option, so users who aren't able to receive HTML mails don't).

These are nice stats... Nice ? Heh, nice is an acronym for great++ [not ending loop :D ]

Okay, newsletter.

You must have a mysql database and php enabled page. Then, make a form where the user will enter it's email address.

Then, just insert that stuff into a mysql db and go further. It'll look something like:

<?
//scripted on the bbs, so no kills for the syntax. some odd errors may
// occur. This is a BBS!
?>
....
<form name="newsletter" id="newsletter" method="post" action="<?=$PHP_SELF?>">
<label>
Your email here
<input type="text" name="mails" size="50">
</label>
<input type="submit" value="Submit!" name="n_submit">
</form>
.....
<?
//process
//put some globals
$mail = $_POST['mails'];
$n_button = $_POST['n_submit'];
// if submited

if ($n_button = 'Submit!') {
# a regular smal selfcheck
if ($mail == "" && empty($mail) ) {
echo "You haven't entered any email";
echo "<br /> \n";
die("Please try again. [a href=\"javascript: history.back();\"]Go Back[/a]");
// replace [ with < and ] with >
}

/* for bigger security you can add a email preg_match function */

$conn = mysql_pconnect (localhost, $username, $password) or trigger_error ("Error: ".mysql_error());
// mysql_pconnect is better
//replace $username and $password with your own username
// and password
//if an error occurs, we won't stop the whole app (even though it is recommended in
// this case. We'll just output errors.

mysql_select_db ($db) or trigger_error("Cannot select the db");
// select the db.
// replace $db with your own mysql database name
$tbl = "your table name"; //replace with your table name
$field = "your field name"; //replace with your field name
$sql = "INSERT INTO $tbl ($field) VALUES ($mail)"; // no needs to replace
mysql_query($sql) or trigger_error ("Cannot add the email $mail to the system");
// done
echo 'Done! \n';

// this can flood your inbox, but if you want to have it...
mail('your@email.com', 'New Newsletter User', "An user with email <strong>$mail</strong> has just joined!");

}
?>

===
That's it. Now you just have to set up the newsletter thing.

It would like :
<?
--- a message
--- submit
---- process
------- select emails from $tbl
--------send newsletter
?>

Hope I helped!