Click to See Complete Forum and Search --> : subscribe/unsubscribe mailinglist code
geek_grrrl
03-02-2003, 06:27 PM
Hiya,
I'm trying to create a form linked to a maling list containing four components:
A box for users to enter their email addresses
Two radio buttons - subscribe & unsubscribe, and
A submit button.
I have two scripts that each contain elements of where I'm heading (see below). I've tried to combine these (and change the subscribe/unsubscribe box to two radio buttons) without much success.
Can anyone point me to an online resource that might help?
Script 1
<form method="POST" action="http://admin-au.server-secure.com/mailinglist/maillist.idc">
<input type="hidden" name="action" value="add">
<input type="hidden" name="mailinglist" value="newsletter@e-xpeditions.com">
<input type="hidden" name="redirect" value="http://www.e-xpeditions.com">
<input type="hidden" name="nowait" value="1">
Email Address<input type="text" name="email" size="20">
<input type="submit" value="Submit" name="Submit">
</form>
Script 2
<form method="POST" action="http://admin-au.server-secure.com/mailinglist/maillist.idc">
<input type="hidden" name="redirect" value="http://www.e-xpeditions.com">
<input type="hidden" name="nowait" value="0">
<p>Mailing List <select name="mailinglist" size="1">
<option value="newsletter@e-xpeditions.com">Our Monthly Newsletter</option>
<option value="recall@e-xpeditions.com">Product Recalls</option>
<option value="Bugs@e-xpeditions.com">Bugs</option>
</select></p>
<p>Email
<input type="text" name="email" size="20"><BR>
<select name="action" size="1">
<option value="add">Add to Mailing List</option>
<option value="remove">Remove from mailinglist</option>
</select>
<input type="submit" value="Submit" name="B1">
</p>
</form>
Muchas Gracias!
What seems to be your problem? I don't think I understand what you need...
geek_grrrl
03-02-2003, 09:27 PM
doh! I need to create a form that looks like the file attached. The two scripts I have contain elements of the final product but I don't know how to combine them to get what I need.
Is this what you are looking for?
<form method="POST" action="http://admin-au.server-secure.com/mailinglist/maillist.idc">
<input type="hidden" name="redirect" value="http://www.e-xpeditions.com">
<input type="hidden" name="nowait" value="0">
<p>Mailing List <select name="mailinglist" size="1">
<option value="newsletter@e-xpeditions.com">Our Monthly Newsletter</option>
<option value="recall@e-xpeditions.com">Product Recalls</option>
<option value="Bugs@e-xpeditions.com">Bugs</option>
</select></p>
<p>Email
<input type="text" name="email" size="20"><BR>
<input type="radio" name="addremove" value="add">
<input type="radio" name="addremove" value="remove">
<input type="submit" value="Submit" name="B1">
</p>
</form>
geek_grrrl
03-03-2003, 05:57 PM
Kind of.
I don't want the first drop down box because I'm always going to be subscribing/ unsubscribing people to the mailing list "newsletter@e-xpeditions.com", so I need to kill that box without breaking the code.
The other thing is that the radio buttons need to relate to whether people are subscribing or unsubscribing (one for each). I don't think the code above does that.
Many thanks for your efforts so far!!
Kissies
Here is some new code for you then...
<form method="POST" action="http://admin-au.server-secure.com/mailinglist/maillist.idc">
<input type="hidden" name="redirect" value="http://www.e-xpeditions.com">
<input type="hidden" name="nowait" value="0">
<p>Email
<input type="text" name="email" size="20"><BR>
<input type="radio" name="addremove" value="add">
<input type="radio" name="addremove" value="remove">
<input type="submit" value="Submit" name="Submit">
</p>
</form>The radio button will return something like this (depending of course how the maillist.idc handles it)
addremove: add (if add is ticked)
addremove: remove (if remove is ticked)
geek_grrrl
03-03-2003, 07:17 PM
Hiya,
We're getting closer. I put the form onto - http://www.jeti.com.au/e-xpeditions/beta/html/maillist_form.html - so I could play with it.
The problem now is that when you hit the submit button, instead of the info flying off to the server you get a second form which pretty much takes us back to square one (see attached file).
Any ideas?
That is going to be a problem with the .idc file in your forms action (action="http://admin-au.server-secure.com/mailinglist/maillist.idc")
I've got no idea what the .idc file is doing, or even what an .idc file is...Never heard of it... :(
BillHely
03-03-2003, 08:05 PM
Originally posted by geek_grrrl
Hiya,
We're getting closer. I put the form onto - http://www.jeti.com.au/e-xpeditions/beta/html/maillist_form.html - so I could play with it.
The problem now is that when you hit the submit button, instead of the info flying off to the server you get a second form which pretty much takes us back to square one (see attached file).
Any ideas?
G'day GG. I assume you know you have to be hosted on an IIS-based server to use an IDC file? If that's a silly question just move right on ...
Microsoft actually has a tutorial on this kind of setup at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dninvbs/html/chaptersixproject1anintranetnewsletter.asp. You may want to start earlier or later than that point. The actual IDC file comes into play at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dninvbs/html/callinginternetdatabaseconnector.asp
Unless you are quite familiar with this sort of project I'd suggest you build the MS example first, get it working, then introduce your own variations.
Hope this helps.
geek_grrrl
03-03-2003, 09:15 PM
Poop! So it's not as easy as sewing the two scripts provided by the ISP together?
I wrote up some PHP for you. Hopefully your server supports it...
<?PHP
if ($Submit)
{
mail("$sendto","$subject","Hi geek_grrrl!\n\nHere are the results of your form!\n\nEmail Address: $email\nAdd or Remove: $addremove.","from: $email\r\n");
header("Location:$redirect");
}
?>
<html>
<head>
</head>
<body>
<form method="POST" action="geek_grrrl.php">
<input type="hidden" name="redirect" value="http://www.e-xpeditions.com">
<input type="hidden" name="sendto" value="you@your.com">
<input type="hidden" name="subject" value="Form Results">
<p>Email
<input type="text" name="email" size="20"><BR>
Add<input type="radio" name="addremove" value="add">
Remove<input type="radio" name="addremove" value="remove">
<input type="submit" value="Submit" name="Submit">
</p>
</form>
</body>
</html>
Should just be two things for you to change.
1. The action of the form needs to be the page itself. So, if you name the page myform.php, you need to change the action to myform.php.
2. The hidden input type named sendto. This is the email address that will receive the form, once you send it. So, you will want to change to your email...
You can also change the subject of the email that you will receive in the hidden field named subject...
The only other thing to remember is that your page must be renamed to a .php extention. Hopefully your server supports PHP!
BillHely
03-03-2003, 09:45 PM
Originally posted by geek_grrrl
Poop! So it's not as easy as sewing the two scripts provided by the ISP together?
Well, it might be, but probably not - everything else has to be just right also. Even a minor syntax error in the IDC file will send things awry. the IDC file is a text file that has to be properly constructed.
At risk of getting furiously glared at: Do you know anything about database-enabled websites?
It's not brain surgery, but it can seem that way if you have never done anything like that and the terminology is unfamiliar.
If you do that tutorial I referred to I think you should quickly get a sufficient grasp to proceed.
BillHely
03-03-2003, 10:08 PM
Originally posted by pyro
I wrote up some PHP for you. Hopefully your server supports it...
Pyro, since the original code she posted was submitting to an IDC file it means the form is working with a database - almost certainly MS Access or SQL.
I don't know if that is what she wanted or needed, but that's what they gave her.
Your solution requires her to personally and manually take further action when she gets a "please subscribe me" eMail from your code.
Really, the easiest way for her to handle subscriptions would be to forget all the database stuff and have a simple form like yours submitting to an Autoresponder. SendFree.Com has a free version (with some adverts) and a paid version (ad free). Let the Autoresponder take care of the subscriber database, sending out the eZine, etc. She can download the subscriber list to local storage anytime she wants.
Originally posted by BillHely
Pyro, since the original code she posted was submitting to an IDC file it means the form is working with a database - almost certainly MS Access or SQL.Ah, I didn't know that. I try to stay away from IIS servers.. :p
Anyway, I assumed that it was just something to submit the form to her, and wouldn't be editing a database. If it is a mySQL database, PHP would have no problem connecting to it and making the changes, but if her server already has a script set to do this, it would be redundant to make another.
geek_grrrl
03-04-2003, 11:40 PM
Hey Fellas,
The two scripts in my initial post did indeed come from my ISP. What I need to do is make a combo of the scripts so that my form contains elements of each (see earlier post from me).
If anyone can help make this beautiful combo (using the scripts we already have >> since they both work beautifully) I'd be might greatful.
I don't see this as redundant since neither of the current scripts meets my needs.
Kissies