You can create an open majordomo list and you can set up your form
so that it emails majordomo and subsribes the address entered into
the form.
The majordomo config option you would need to set is:
subscribe_policy = auto
Your HTML form might look something like this:
<FORM ACTION="publiclists.php" METHOD="POST" NAME="finearts">
<TABLE BORDER="0">
<TR><TD VALIGN="BOTTOM">
<FONT FACE="HELVETICA,ARIAL"><B>action</B></FONT><BR>
<SELECT NAME="action">
<OPTION VALUE="-1">click here</OPTION>
<OPTION VALUE="subscribe">add me to the list</OPTION>
<OPTION VALUE="unsubscribe">take me off of the list</OPTION>
</SELECT>
</TD><TD VALIGN="BOTTOM">
<FONT FACE="HELVETICA,ARIAL"><B>email address</B></FONT><BR>
<INPUT NAME="email" SIZE="30">
</TD></TR>
<TR><TD COLSPAN="2">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Send">
</TD></TR>
</TABLE>
<INPUT TYPE="HIDDEN" NAME="list" VALUE="fine-arts">
</FORM>
This form assumes that you have php scripting ability on your server.
The PHP script "publiclists.php" might look like this:
<?php
/* this list takes three parameters and un/subscribes someone
to an email list:
email - the email address to un/subscirbe
list - the name of the list to un/subscribe email from/to
action - specifies subscribe or unsubscribe
*/
$errors = 0;
$errmsg = "";
if($action == -1) {
$errors++;
$errmsg .= "You must select an action (add to list/remove from list)\n"; }
$email = ereg_replace("^[[:space:]]+", "", $email);
$email = strtolower($email);
/* ugly, hideous email address format checker.... */
if(! (ereg("^[^[:space:]]+\@[a-zA-Z\-\.]+\.[a-zA-Z]+$", $email))) {
$errors++;
$errmsg .= "You must enter a valid email address.\n";
}
if($errors == 0) {
mail("majordomo@yourdomain.com", "", "$action $list $email", "From: owner-" . $list . "@yourdomain.com");
}
// redirect user's browser back to the form
Header("Location: http://www.yourdomain.com/locationof/yourform.php?errmsg=" . urlencode("$errmsg") . "&errors=$errors");
?>
On Fri, 10 May 2002, ORANGE|Ron wrote:
> Hey all... I want to use a form to place at the site so people can input
> their email addresses, click a button and be signed up for our newsletter.
>
> I have been using Yahoo! Groups form in the past and would like to get
> everyone on our Majordomo list.
>
> Is it possible, and if so, what is the code for that form?
>
> I would like people to be able to just input their name, and click a link,
> that is it - automatically signed up and they are able to stay at the
> site.... I do not want them to have to email or go to an external site to
> sign up and accept the list... Make sense?
>
>
> Thanks alot
> RON
>
> President
> ORANGE RECORDINGS
> www.orangerecordings.com
References:
|
|