This document contains conceptual information and code samples that you can use when configuring the Web Collect feature. Contact your ExactTarget representative to enable this feature on your account.

Audience

This document is intended for business managers, system administrators, and other ExactTarget users who are responsible for enabling the Web Collect functionality by adding required HTML code to your corporate web site.

What Is Web Collect

You can use Web Collect and HTML code incorporated into your web page to allow your web site visitors to subscribe to or unsubscribe from your email publications.

Why Use Web Collect

By inserting the code described in this document (with modifications to replace the sample content with content specific to your account data) into your web page, you'll be able to do the following:

  • Allow your web site visitors to subscribe to your email publications and thus be added to the appropriate subscriber lists in your ExactTarget account.
  • Allow your existing subscribers to unsubscribe from your email publications and thus be removed from the appropriate subscriber lists in your ExactTarget account.
  • Allow your existing subscribers to update the profile data that you maintain for them in your ExactTarget account.
  • Ensure that all data entered by your web site visitors into the Web Collect form will be valid when saved to your ExactTarget account.
  • Capture errors encountered by your web site visitors in this process and display friendly messages to your visitors.

The code samples shown in this document are available in text file format for easier copying and pasting. The code sample section of this document contains the download link.

You can use a triggered send to send an automatic email to subscribers who add themselves to lists using the Web Collect feature.

How to Use Web Collect

To build your Web Collect page, you'll need the list ID of each exposed subscriber list. Additionally, you'll need to pass your ExactTarget member ID (account ID) in your form. These requirements, along with the supporting pages needed, are described in the following sections.

You can use Web Collect to add names to publication, suppression, and subscriber lists. However, remember that you can only send messages to subscriber lists. The ExactTarget application uses publication and suppression lists in conjunction with data extensions to control unsubscribes; it does not send directly to the subscribers on the publication or subscription list.
For server-side requests, you must include a Content-Type header of "application/x-www-form-urlencoded" in your form. The server does not add this header by default.

List Requirements

For each list that you want to expose to your web site visitors for subscribing to or unsubscribing from, you'll need to obtain the ExactTarget list ID and confirm that the list is defined as a public list.

That list ID must also be included in any opt-in links for triggered email sends. For example, in the link below, you would replace <<LID>> with the list ID number and include it in your transactional send to a subscriber in order to add them to your subscriber list.

http://cl.exct.net/sub_confirm.asp?lst=<<LID>>_HTML&eml=%%EmailAddr_%%&mid=%%MemberID%%

Member ID

Your Web Collect submission form must include your ExactTarget member ID (MID) as a hidden input field.
You can find your member ID in the upper-right corner of your ExactTarget application, next to your account name. In the following sample illustration, the member ID is 3133.

File:Web_Collect/member-ID.JPG

For this example, the MID would be passed as follows:

<input type="hidden" name="MID" value="3133" />

See the Code Samples section at the end of this document.

Supporting Pages

You'll need to set up the following supporting pages on the web site containing your Web Collect form. Your Web Collect code will link to these pages.

  • Error page: To be displayed when a web site visitor experiences an error. Build your Error page to display a friendly error description corresponding to the error code returned to you via the URL. See possible error codes that the ExactTarget application will return.
  • Thank You page: To be displayed after a web site visitor has successfully added himself or herself to a list or modified his or her profile.
  • Unsubscribe Confirmation page: To be displayed when a subscriber has successfully removed himself or herself from a list.
If you use the S4 instance, you must set up your pages by substituting "cl.s4.exct.net" instead of "cl.exct.net" in the sample code examples shown below.

Flash Support

The Web Collect feature supports the direct submission of data from your client-side Flash application using ActionScript or Flex.

For example, the following sample uses ActionScript 3.0 to submit customer data:

<br><br>
private function sendSubcription():void{<br>
var request:URLRequest = new URLRequest("http://cl.exct.net/subscribe.aspx?lid=LISTID");<br>
var sendVars:URLVariables = new URLVariables();<br>
sendVars.thx = "http://THANKYOUPAGE";<br>
sendVars.err = "http://ERRORPAGE";<br>
sendVars.usub = "http://UNSUBSCRIBE";<br>
sendVars.mid = "MEMBERID";<br>
sendVars.SubAction = "sub_add_update";<br>
sendVars["Email Address"] = emailaddress.text;<br>
sendVars["Full Name"] = fullname.text;<br>
sendVars["Subscriber Key"] = ETSubscriberKey.text;<br>
request.method = URLRequestMethod.POST;<br>
request.data = sendVars;<br>
navigateToURL(request);<br>

}

Exposing Profile Data

Your web site can allow your subscribers to update their profile and preference attributes.

About Subscriber Attributes

Make sure that the attribute field names and types in your submission form exactly match what's defined in your ExactTarget application. To check the data type and other properties of an attribute, go to the attribute's Properties dialog box, which you access from the Subscribers»Profile Management area of the application.

For an example of the attribute fields that you might want to include on your Web Collect form (such as name, email address, or subscriber key), see the Profile Center that ExactTarget displays when a subscriber clicks the "modify profile" link in the emails you send. To see what the Profile Center looks like, go to the Subscribers»Profile Management area of your ExactTarget application and choose the Preview Profile Center option in the toolbar. The Profile Center displays all attributes that are not defined as "hidden" in your account.

The number of attributes you can have in your account and whether you can create new attributes are determined by your account configuration. Contact your ExactTarget account manager if you have questions. For example, you must have the Subscriber Key feature enabled for your account if you wish to use that attribute in conjunction with Web Collect.

File:Web_Collect/Preview-Profile-Center.JPG

Remember: If you're using your web site to allow new subscribers to sign up, you must pass data for all required profile and preference attributes - including those that are defined as "hidden" - for the new subscriber. See the attribute's Properties dialog box to check whether the attribute is required or not. For example, the Email Address attribute is always required:

File:Web_Collect/email-address-properties.JPG

Handling Restricted-Value Attributes

If the attribute is defined in your ExactTarget account as having restricted values (a drop-down list of all possible values), you need to present each value exactly as it's defined in the application. These values are case-sensitive.

In the following example, the attribute name is Industry, and it's defined as having six possible values. The following code will prompt the user to select an industry from the options given.

<p><b>Industry: </b>
<select name="Industry">
<option name = "Industry" value="">Please select an industry.</option>
<option name = "Industry" value="Automotive">Automotive</option>
<option name = "Industry" value="Banking">Banking</option>
<option name = "Industry" value="Call Center">Call Center</option>
<option name = "Industry" value="Consultant">Consultant</option>
<option name = "Industry" value="Education">Education</option>
<option name = "Industry" value="Government">Government</option>
</select></p>

If the restricted-value attribute is required and you do not want to expose it to your web site visitors, do not pass the value and the system sets the attribute to the default value.

You define the default value for an attribute on the Data tab of the attribute's Properties dialog box:

File:Web_Collect/new-attribute-properties.JPG

On Your Behalf Accounts (Enterprise)

If you use an ExactTarget Enterprise account and you want to set up a Web Collect form for your On Your Behalf accounts, the member ID of the account (the channel member ID) is a required input field on your submission form.

<INPUT TYPE="HIDDEN" name="ChannelMemberID" VALUE="OYB account number" />

Use the following steps to find the account number of the On Your Behalf account:

  1. Select the Admin tab in the navigation bar.
  2. Select Organizational Chart.
  3. Select the desired account to find the Member ID (MID) value.

Offering Option to Subscribe, Unsubscribe, and/or Update Profile

You can offer your web site visitors the option of subscribing to a single list or multiple lists. Existing subscribers can be offered the option of updating their profile data or unsubscribing. Offer existing subscribers the option to unsubscribe from the All Subscriber list to provide a method for subscribers to globally unsubscribe.

Use the SubAction type appropriate to your needs:

Subaction Description and Example
sub

Allow the visitor to be added to a list only.

For example, to add the visitor as a subscriber to a list without updating any profile data, use the following form element:

<input type="radio" name="SubAction" value="sub" checked="checked" />                   <font face="Verdana" size="2">Subscribe</font>

sub_add_update

Allow the visitor to be added to a list or, if the visitor already belongs to the list, allow the visitor to update his or her profile data.

For example, to add a visitor as a subscriber to a list or to allow existing subscribers to update their profile data, use the following form element:

<input type="radio" name="SubAction" value="sub_add_update" checked="checked" />        <font face="Verdana" size="2">Subscribe</font>

unsub Allow the visitor to unsubscribe from a list.

See the Code Samples section at the end of this document.

Handling Errors

All errors are passed in the QueryString of the error page URL, with the following variables:

  • errorCode: Contains the numeric error code.
  • errorControl: Contains the name of the field that triggered the error.

The following table lists the possible error codes and their associated errorControl values, along with a description of each error.
 

Error Code Error Description Value Returned in errorControl
1, 6, 7 , 9, and 10 An error has occurred while attempting to save your subscriber information. Blank.
2 The list provided does not exist. Blank.
3 Information was not provided for a mandatory field. The name of the required field that the subscriber did not complete.
4 Invalid information was provided. The name of the field in which the subscriber entered invalid data.
5 Information provided is not unique. The name of the field in which the subscriber entered data that duplicates data already in your database for that field.
8 Subscriber already exists. The list ID of the list to which the subscriber already belongs.
12 The subscriber you are attempting to insert is on the master unsubscribe list or the global unsubscribe list. The list ID of the unsubscribe list.
14 The query string contains ETsubscriberKey and the Subscriber Key feature is not enabled on your account. The name of the field.

See the Error Codes 4, 10, and 13 troubleshooting section for common reasons behind receiving these errors.

How To Define a List's Opt-In Status for Web Collect

You can set a list's opt-in status and set up confirmation emails through the List Properties dialog box. The opt-in feature applies when a subscriber is added to a list via your Web Collect form.

Follow these steps to view the opt-in status:

  1. Select the list in the list workspace.
  2. Click Properties in the list workspace toolbar.
  3. Click the plus sign next to the Opt-in Behavior heading on the Edit Properties tab.
  4. If you want subscribers to confirm their email address as part of a double opt-in procedure, click the Require subscribers to provide confirmation of valid email address (double opt-in) checkbox, then click Select next to the the Email field and choose you wish to send as part of the confirmation process. You must insert the following link in the confirmation email:
    http://cl.exct.net/sub_confirm.asp?lst=%%List_%%&eml=%%EmailAddr_%%&mid=%%MemberID
  5. In the Opt-in Landing Page section, define the landing page a subscriber sees upon responding to the confirmation email. Choose from the following options:
    • Use default landing page: The subscriber sees a generic message.
    • Redirect subscribers to a web site: The subscriber is sent to the web site that you enter in the text box.
    • Redirect subscribers to the following landing page: The subscriber sees the landing page that you select in the text box. Click the Select button to pick a landing page you've previously created, and click Preview to view the landing page you selected.
    You must first create and publish the landing page before choosing to use it as part of the Web Collect opt-in feature.
    The subscriber initially joins the list with an unsubscribed status. The application sends a triggered email, and the subscriber's status changes to subscribed if/when they reply to the triggered email's request for confirmation.
  6. In the Welcome Email section, decide whether or not you want to send a welcome email after a subscriber opts to join your list. If you do choose to send a welcome email, select the email you wish to send by clicking Select next to the Email field and choosing the email you wish to send.

The opt-in behavior that you defined for this list takes effect immediately and is applied to all subscribers added to the list via your Web Collect form in the future.

Troubleshooting

Here are helpful hints to troubleshoot issues you might encounter.

Hard Line Breaks in Data

Issue: The data that you're passing contains hard line breaks (hard returns), which are breaking the functionality.

Resolution: The Web Collect feature does not support hard line breaks in submitted data. If you want to use a textarea element on your page for subscribers to submit extensive information, you must remove the hard line breaks prior to passing the data to ExactTarget, which you can do with an onSubmit function. Here's an example of this function:

function fReplace(){
var str = document.myForm.myTextArea.value;
str = str.replace(/(\r\n)/g,'');
document.myForm.myTextArea.value = str;
return false;
}
</script>

Subscriber Not Being Added to List

Issue: The Web Collect form on your site is not adding subscribers to your list.

Possible resolutions:

  • Check that the list ID specified in your code is correct. See List Requirements.
  • Check the URL that appears in the browser address bar after the data is submitted. If an error is occurring, the errorControl field in the URL will indicate which attribute is causing the error.

"Page Cannot Be Displayed"

Issue: The Web Collect form on your web page is producing "Page cannot be displayed" errors.

Possible resolutions:

  • Check the URLs specified in your code for your Thank You, Error, and Unsubscribe Confirmation pages to ensure that the URLs are correct.
  • Ensure that the quotation marks around the thx, err, and unsub values in your code are straight quotes. If you wrote the code in a word-processing program, they might be curly quotes, also known as high ASCII quotes. Replace them with straight quotes.

Error Codes 4, 10, and 13

Issue: Your Web Collect users are experiencing error code 4.

Possible resolutions for error code 4:

  • If the error is occurring for a restricted-value attribute, remember that you must pass values for the attribute in the manner described in the Handling Restricted-Value Attributes section.
  • If the error is occurring for a restricted-value attribute, check that you've entered the possible attribute values in your code exactly as they're defined in the application, including case (lowercase and uppercase).
  • Troubleshooting
  • If the error is occurring for a phone number or social security number field (or a similar field that mixes numbers with other characters), check that the attribute field is set up in your ExactTarget application with the Text data type rather than the Numeric data type. A Numeric field will not accept dashes, parentheses, or any other non-numeric character.
  • Check the minimum length defined for the attribute on the Data tab of the attribute's Properties dialog box. Did your web site user skip a field that's defined to have a minimum length greater than zero? To resolve this issue, either make the field required so that users cannot leave it blank, or remove the minimum length property on the attribute.
  • Check the maximum length defined for the attribute on the Data tab of the attribute's Properties dialog box. Did your web site user's entry for this field exceed the field's maximum length? This error commonly occurs when a phone number field is set to a maximum of 10 characters, but the web site user enters 10 numbers plus parentheses and dashes. To resolve this issue, increase the maximum length value in the attribute's properties.

Issue: Your Web Collect users are experiencing error code 10.

Possible resolutions for error code 10:

  • Check that your Web Collect form is requiring all attributes that are defined as required in your ExactTarget application. Whether or not the application requires an attribute is controlled by the Required check box in the attribute's Properties dialog box.
  • The problems with restricted-value attributes described for error code 4, above, can also cause error code 10.
  • The curly-quote problem described for "Page cannot be displayed" errors, above, can also cause error code 10.

Issue: Your Web Collect users are experiencing error code 13.

Possible resolutions for error code 13:

  • Check that the list ID specified in your code is correct. See List Requirements.
  • Check that the member ID specified in your code is correct. See Member ID.

Code Samples

In the following samples, the code that you will customize with your own supporting pages and attributes are shown in bold red font.

These samples illustrate the code for an account with the ExactTarget default attributes:

  • Full Name, which is being displayed on the web page as Name.
  • User Defined, which is being displayed as Company Name.
  • Email Address, which is being displayed as Email.
  • The preference attribute Email Type, which offers the subscriber the options of HTML and Text.

The following code samples are available in this document and in individual text files that you can download in a zipped file from this link: http://memberlandingpages.com/help/webcollect/WebCollectCodeSamples.zip. If you use the S4 instance, download the code samples in a zipped file from this link: http://memberlandingpages.com/help/webcollect/WebCollectCodeSamplesS4.zip.

 

Sample Code Text File
Subscribing to or Unsubscribing from a Single List Subscribe-Unsubscribe_Single_List.txt
Subscribing to Multiple Lists Subscribe_Multiple_Lists.txt
Subscribing to or Unsubscribing from Multiple Lists Subscribe-Unsubscribe_Multiple_Lists.txt
Parsing Error Codes: PHP Parsing_Error_Codes_PHP.txt
Parsing Error Codes: ASP Parsing_Error_Codes_ASP.txt
Parsing Error Codes: Perl Parsing_Error_Codes_Perl.txt

Sample Code for Subscribing to or Unsubscribing from a Single List

Your code needs to include script that validates the email address entered by your website user. The downloadable versions of these code samples include an example of this email validation script, which is not shown here.
<form action="http://cl.exct.net/subscribe.aspx?lid=Your list ID Here" name="subscribeForm" method="post">
<input type="hidden" name="thx" value="Your thank you page here" />
<input type="hidden" name="err" value="Your error page here" />
<input type="hidden" name="usub" value="Your success unsub page here" />
<input type="hidden" name="MID" value="Your member ID here" />
<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td><font face="Verdana" size="2">Name:</font></td>
        <td><input type="text" name="Full Name" /></td>
    </tr>
    <tr>
        <td><font face="Verdana" size="2">Company Name:</font></td>
        <td><input type="text" name="User Defined" /></td>
    </tr>
    <tr>
        <td><font face="Verdana" size="2">Email:</font></td>
        <td><input type="text" name="Email Address" /></td>
    </tr>
    <tr>
        <td><input type="radio" name="Email Type" value="HTML" checked="checked" />
        <font face="Verdana" size="2">HTML</font>
    </td>
        <td>
            <input type="radio" name="Email Type" value="TEXT" />
            <font face="Verdana" size="2"> Text</font>
        </td>
    </tr>
    <tr>
        <td>
            <input type="radio" name="SubAction" value="sub_add_update" checked="checked" />
            <font face="Verdana" size="2">Subscribe</font>
        </td>
        <td>
            <input type="radio" name="SubAction" value="unsub" />
            <font face="Verdana" size="2">Unsubscribe</font>
        </td>
    </tr>
    <tr>
        <td>
            <input type="submit" value="Submit" /></td>
            <td align="right">
            <font face="verdana" size="1" color="#4C5487">
            Powered by<br> <a href="http://www.exacttarget.com">
            <img src="http://www.exacttarget.com/gfx/smalllogo.gif" border="0"></a>
            </font>
        </td>
    </tr>
</table>                                                                                                                                                                          </form>

Sample Code for Subscribing to Multiple Lists

Your code needs to include script that validates the email address entered by your website user. The downloadable versions of these code samples include an example of this email validation script, which is not shown here.
<form action="http://cl.exct.net/subscribe.aspx" name="subscribeForm" method="post">
<input type="hidden" name="thx" value="Your thank you page here" />
<input type="hidden" name="err" value="Your error page here" />
<input type="hidden" name="SubAction" value="sub" />
<input type="hidden" name="MID" value="Your member ID here" />
<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td><font face="Verdana" size="2">Name:</font></td>
        <td><input type="text" name="Full Name" /></td>
    </tr>
    <tr>
        <td><font face="Verdana" size="2">Company Name:</font></td>
        <td><input type="text" name="User Defined" /></td>
    </tr>
    <tr>
        <td><font face="Verdana" size="2">Email:</font></td>
        <td><input type="text" name="Email Address" /></td>
    </tr>
    <tr>
        <td>
            <input type="radio" name="Email Type" value="HTML" checked="checked" />
            <font face="Verdana" size="2">HTML</font>
        </td>
        <td>
            <input type="radio" name="Email Type" value="TEXT" />
            <font face="Verdana" size="2"> Text</font>
        </td>
    </tr>
    <tr>
        <td align=right>
            <input type="checkbox" name="lid" value="First list ID here" />
        </td>
        <td>
            <font face="Verdana" size="2">First list name here</font>
        </td>
    </tr>
    <tr>
        <td align=right>
            <input type="checkbox" name="lid" value="Second list ID here" />
        </td>
        <td><font face="Verdana" size="2">Second list name here</font></td>
    </tr>
    <tr>
        <td align=right>
            <input type="checkbox" name="lid" value="Third list ID here" />
        </td>
        <td>
            <font face="Verdana" size="2">Third list name here</font>
        </td>
    </tr>
    <tr>
        <td align=right>
            <input type="checkbox" name="lid" value="Fourth list ID here" />
        </td>
        <td>
            <font face="Verdana" size="2">Fourth list name here</font>
        </td>
    </tr>
    <tr>
        <td>
            <input type="submit" value="Submit" />
        </td>
    </font>
    </td>
    </tr>
</table>
</form>

Sample Code for Subscribing to or Unsubscribing from Multiple Lists

Your code needs to include script that validates the email address entered by your website user. The downloadable versions of these code samples include an example of this email validation script, which is not shown here.
<form action=" http://cl.exct.net/subscribe.aspx" name="subscribeForm" method="post">
<input type="hidden" name="thx" value="Your thank you page here" />
<input type="hidden" name="err" value="Your error page here" />
<input type="hidden" name="usub" value="Your success unsub page here" />
<input type="hidden" name="MID" value="Your member ID here" />
<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td><font face="Verdana" size="2">Name:</font></td>
        <td><input type="text" name="Full Name" /></td>
    </tr>
    <tr>
        <td><font face="Verdana" size="2">Company Name:</font></td>
        <td><input type="text" name="User Defined" /></td>
    </tr>
    <tr>
        <td><font face="Verdana" size="2">Email:</font></td>
        <td><input type="text" name="Email Address" /></td>
    </tr>
    <tr>
        <td><font face="Verdana" size="2">Subscriber Key</font></td>
        <td>input type="text" name="Subscriber Key" /></td>
    </tr>
    <tr>
        <td>
            <input type="radio" name="Email Type" value="HTML" checked="checked" />
            <font face="Verdana" size="2">HTML</font>
        </td>
        <td>
            <input type="radio" name="Email Type" value="TEXT" />
            <font face="Verdana" size="2"> Text</font>
        </td>
    </tr>
    <tr>
        <td align=right>
            <input type="checkbox" name="lid" value="First list ID here" />
        </td>
        <td>
            <font face="Verdana" size="2">First list name here</font>
        </td>
    </tr>
    <tr>
        <td align=right>
            <input type="checkbox" name="lid" value="Second list ID here" />
        </td>
        <td>
            <font face="Verdana" size="2">Second list name here</font>
        </td>
    </tr>
    <tr>
        <td align=right>
            <input type="checkbox" name="lid" value="Third list ID here" />
        </td>
        <td>
            <font face="Verdana" size="2">Third list name here</font>
        </td>
    </tr>
    <tr>
        <td align=right>
            <input type="checkbox" name="lid" value="Fourth list ID here" />
        </td>
        <td><font face="Verdana" size="2">Fourth list name here</font></td>
    </tr>
        <td>
            <input type="radio" name="SubAction" value="sub" checked="checked" />
            <font face="Verdana" size="2">Subscribe</font>
        </td>
        <td>
            <input type="radio" name="SubAction" value="unsub" />
            <font face="Verdana" size="2">Unsubscribe</font>
        </td>
    <tr>
        <td>
            <input type="submit" value="Submit" />
        </td>
        <td align="right">
        </td>
    </tr>
</table>
</form>

Sample Code for Parsing Error Codes: PHP

<?php
$errorcode = $_GET["errorcode"];
$errorcontrol = $_GET["errorControl"];

switch($errorcode) {

case "1" : $strError = "An error has occurred while attempting to save your subscriber information."; break;
case "2" : $strError = "The list provided does not exist."; break;
case "3" : $strError = "Information was not provided for a mandatory field. (".$errorcontrol.")"; break;
case "4" : $strError = "Invalid information was provided. (".$errorcontrol.")"; break;
case "5" : $strError = "Information provided is not unique. (".$errorcontrol.")"; break;
case "6" : $strError = "An error has occurred while attempting to save your subscriber information."; break;
case "7" : $strError = "An error has occurred while attempting to save your subscriber information."; break;
case "8" : $strError = "Subscriber already exists."; break;
case "9" : $strError = "An error has occurred while attempting to save your subscriber information."; break;
case "10" : $strError = "An error has occurred while attempting to save your subscriber information."; break;
case "12" : $strError = "The subscriber you are attempting to insert is on the master unsubscribe list or the global unsubscribe list."; break;
default : $strError = "Other"; break;
}

?>
<HTML><HEAD>
</HEAD>
<BODY>
<? echo 'Error: ('.$errorcode.') '.$strError; ?>
</BODY>
</HTML>

Sample Code for Parsing Error Codes: ASP

<%
errorcode = Request.QueryString("errorcode")
errorcontrol = Request.QueryString("errorControl")

select case errorcode
    case "1", "6", "7", "9", "10"
        strError = "An error has occurred while attempting to save your subscriber information."
    case "2"
        strError = "The list provided does not exist."
    case "3"
        strError = "Information was not provided for a mandatory field. (" & errorcontrol & ")"
    case "4"
        strError = "Invalid information was provided. (" & errorcontrol & ")"
    case "5"
        strError = "Information provided is not unique. (" & errorcontrol & ")"
    case "8"
        strError = "You have already subscribed to this list."
    case "12"
        strError = "The email address is already unsubscribed."
end select

%>
<HTML><HEAD>
</HEAD>
<BODY>
<% Response.Write "Error: (" & errorcode & ") " & strError %>
</BODY>
</HTML>

Sample Code for Parsing Error Codes: Perl

#!/bin/perl 
use strict; 
use CGI qw/:standard/;
 my %strError = (  1 => "An error has occurred while attempting to save your subscriber information.",  2 => "The list provided does not exist.",  3 => "Information was not provided for a mandatory field. (".param('errorControl').")",  4 => "Invalid information was provided. (".param('errorControl').")",  5 => "Information provided is not unique. (".param('errorControl').")",  6 => "An error has occurred while attempting to save your subscriber information.",  7 => "An error has occurred while attempting to save your subscriber information.",  8 => "You have already subscribed to this list.",  9 => "An error has occurred while attempting to save your subscriber information.",  10 => "An error has occurred while attempting to save your subscriber information.",  12 => "The email address is already unsubscribed.", );

print header, start_html, "Error: (".param('errorcode').") ".$strError{param('errorcode')} || "Invalid Entry", end_html;

This page was last updated by Ryan Williams. To send Ryan direct feedback, fill out the form below:

Enter the digits 18095 backwards:
   
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Tag page
You must login to post a comment.