Simple php based subscription submision box

I have a static website on a LAMP. I already use a PHP script for the contact form. Now I need a small subscription box - PHP based - where people can leave / submit their email address so the client can send them e-letter or updates by email.  I considered a free MailChimp account first, but it seems rather hard to make my own subscription box connected to a MailChimp account so I am considering a simple email submission form that is not to vulnerable spam wise. Any scripts out there or other solutions available for me?
rhandalthorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

john-formbyCommented:
Do you just want to be emailed the email address or do you want to store the submitted email in a database?
0
V4nP3rs13Commented:
Check out on hotscripts.com
there are many scripts for this, and all is free
0
V4nP3rs13Commented:
Check out on hotscripts.com
there are many scripts for this, and all is free
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

rhandalthorAuthor Commented:
@ john-formby I was more thinking about emailing it to an email address for now.
@ V4nP3rs13 I am familiar with hotscripts. Just rather vast. Will have another look
@ all Any favorite scripts for just sending an email address to a designated email address?
0
rhandalthorAuthor Commented:
Found PHPMailer: http://www.phphq.net/scripts.php?script=phMailer#phMailer , but it seems to be a bit too much for just sending an email address to a designated email address. Furthermore I am not certain if it is spam proof. Anybody any experience with this script in using at as a subscription form box? Any other options?
0
rhandalthorAuthor Commented:
Anyone any feedback on this?
0
john-formbyCommented:
A lot of scripts will package other functionality.  If all you want is a simple script to send a submitted email address to you, then please see the little script I have written below.  This should do exactly what you need.

Just change the $to email to yours and upload to your server.

Hope this helps,

John
<?php
if(isset($_POST['submit'])) {
	$email = $_POST['email'];
	if($email == '') {
		$errormsg = 'Error: No email entered';
	} elseif(!preg_match('/^[^@]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$/', $email)) {
		$errormsg = 'Error: Invalid email address';
	}
	if($errormsg == '') {
		$to = 'you@youremail.com';
		$subject = "Newsletter Subscriber";
		$message = "Please add the following email to your mailing list:\n\n$email";
		$headers = "From: $email";
		mail($to,$subject,$message,$headers);
		$successmsg = 'Success: Mail Sent';
	}
}
?>
<html>
<head>
<title>Email Submission</title>
</head>
<body>
<?php 
echo $errormsg;
echo $successmsg;
?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
Email: <input type="text" name="email" /> <input type="submit" name="submit" value="Send" />
</form>
</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rhandalthorAuthor Commented:
Thanks John-formby. Will use this one.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.