This feature allows you to subscribe people without the use of a form. This is useful if you already have a member database of some kind, and would like to allow members to subscribe to mailing list by just clicking a link. The "query string" is the text after the question mark after the script filename (so: subscriber.cgi?query_string_here). Here is the format of the query string to pass along subscriber information to the script:
http://path/to/subscriber.cgi?subscribe&&EMAIL&&LIST1,LIST2,ETC&&HTML1/0&&NAME&&ADDRESS1&&ADDRESS2&&COUNTRY&&PHONE&&SLOTNAME=BLAH++SLOTNAME2=BLAHAHNotice that you must place two ampersands (&&) between each item in the query string. Here is what each means (along with the equivalent value from a form):
subscribe: tells script that you're going to pass subscription information to it
+ Form equivalent: n/a
email: the email address that you want to subscribe
+ Form equivalent: address
list1,list2,list3,etc: the directories of the lists you want the address to be subscribed to (seperate by commas -- just like they are in a form that doesn't use checkboxes)
+ Form equivalent: lists (w/o checkboxes)
HTML1/0: set this to 1 for HTML or 0 for plain text subscription (if ANYthing besides 1, the script will set the value to plain text) name: the name of subscriber
+ Form equivalent: name
address1: first line of mailing address
+ Form equivalent: address_m1
address2: second line of mailing address
+ Form equivalent: address_m2
country: the country the subscriber is from
+ Form equivalent: country
phone: the subscriber's phone number
+ Form equivalent: phone
SLOTNAME=BLAH++SLOTNAME2=BLAHAH: these are the values for slots. SLOTNAME needs to be the name of the slot (the name as it was created, and just what is used in a subscription form). Then, you must supply the value for that slot. For example, title=Mr.++position=CEO. Each additional slot must be seperated by two plus signs.
Just like form field values, everything in the query string is CasE SenSiTIve. You MUST supply "blanks" for every value that you're not going to use. For example, if you don't use addresses or a phone number, but used everything else, you will still have to supply the address part of the query string, but just leaving it blank: firstname.lastname@example.org&&my_list1,my_list2&&1&&Bob&&&&&&UK&&&&user_title=Mr.++position=manager
Notice the string of amps? The script splits the query string by those two ampersands, so if you have a block of four (or six in this example) amps, the script would read that one value as blank and not it wouldn't be used. This is just like leaving it out of the subscription form.
The parts of the string must ALWAYS be in the same order. You don't have to supply anything beyond the first three that I already mentioned as required. But, if you are going to use, for example, two slot-based variables, but none (or very little) of the other information fields, you must supply the correct number of ampersands as shown above. You should be able to include spaces in the URL without any problems. They SHOULD be converted to %20 by the browser, which is then turned back into a space by the script before it's stored as a variable. So basically, don't be worried about including spaced items. You can also include things with ampersands and plus signs, just as long as it's just a single character and not doubled. For instance, you CAN have something like "Jim & Bob" but not "Jim && Bob." The second one would cause the script to read "Jim " as a value and " Bob" as the other, and it would throw off everything thereafter...
Back to Index