Re: Newbie Form Question

From: Date: Fri, 04 Aug 2006 20:18:13 +0000
Subject: Re: Newbie Form Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-240150@lists.php.net to get a copy of this message
On Fri, August 4, 2006 7:14 am, David Ellsworth wrote: > I was wondering how simple it would be to set up a script to provide a > subscribe/unsubscribe form for a list serve. The form would send an > email to > the subscribe address or unsubscribe address as selected. It's pretty simple: <?php if (isset($_REQUEST['email'])){ $success = mail($_REQUEST['action'], 'un/subscribe', 'un/subscribe', "From: $_REQUEST[email]\r\nReply-to: $_REQUEST[email]"); if ($success) echo "Status Change Sent"; else echo "Unable to send Status Change"; } ?> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <input type="radio" name="action" value="subscribe@lists.php.net"> Subscribe <input type="radio" name="action" value="unsubscribe@lists.php.net"> Unsubscribe<br /> <input name="email"> </form> -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#240150) next »