ModularMerchant
MMv4 Knowledge Base
Shopping Cart Software Knowledge Base
If it can be known about the shopping cart software, it is here.
Controlling the RMV System's Behavior with Variables Working with RMV XML Data
Home > Shopping Cart Software Components > Administration Area > Modules > Subscription Products > FAQs & Tutorials > Working with RMV System Errors

Working with RMV System Errors

Modular Merchant's Remote Membership Validation (RMV) system makes it simple to set up a "members-only" area on your website where your customers can log in to access content that they have purchased. When a customer purchases an eligible product, they will automatically gain access to the protected membership area on your website. Anyone who has not purchased that product won't have access to the website!

There are two ways to communicate with the RMV system, simple mode and XML mode. But, whichever method your script is using to communicate with it, the RMV system will return a list of any error messages it encounters when the customer tries to log in.

How are the error messages formatted?

  • When using the simple mode, the errors are returned as a pipe-delimited string.
  • When using the XML mode, the errors are returned in a section of the XML data.
  • However, whether using simple or XML mode, the mm_membership_validator.php file will also create an array named $errors, which will contain all errors returned by the RMV system. This array can make it easier to evaluate and display any error messages encountered, because no matter which system you're using, the format of the $errors array will always be the same.
 
Example of displaying error messages

Here is some PHP code that can be used on your RMA login page to display any errors generated during the login process. This same code will work whether you're using the simple mode or XML mode.

code
<?php
    
if(count($errors) > 0) {
        echo(
'<p>The following errors were encountered when attempting to log in:</p>');
        echo(
implode('<br />'$errors));   
    }
    
?>

The code above does the following things:

  • First, it counts the size of the $errors array, to see if it contains anything. If its size is greater than zero, then we know that there are error messages to be displayed.
  • The implode() function will allow us to display each error message in the array, no matter how many there are. Each error message will be separated by "<br />", which is a line break.

The sample code above provides a simple way to determine whether errors were encountered during the customer's attempt to log in to your website's Membership Area, and then display any error messages that were encountered. This sample is meant to be used as a starting point. You're welcome to expand on this concept to make the error reporting in your own RMV script as elaborate as you like.



— Last Edited - 02/22/2012 11:01am PST
Related Articles
Create Members-Only Websites: RMV Method

Category: Shopping Cart Software Components
Rank and add a comment to this article
Only logged in users may leave comments and rank articles. Log in to have your say!
  Knowledge Base Home

  QuickCode™ Tag Glossary

  Modular Merchant.com Homepage

Not Logged in.
Either Log in or create a User Account.

Other articles in this category...

Creating Members-Only Websites: Introduction

How off-site payment gateway subscriptions are handled

Troubleshooting RMV installations

What to check if your subscriptions aren't being processed

Create Members-Only Websites: Simple Method

Create Members-Only Websites: RMV Method

Controlling the RMV System's Behavior with Variables

Working with RMV System Errors

Working with RMV XML Data

Sell a Product with a Free Trial Period