Chapter 13: Tell-a-Friend System 459 (Web site translator) . The encrypted

Chapter 13: Tell-a-Friend System 459 . The encrypted check flag is decrypted and matched with the other parameters from the link. If the matching fails, the method returns false. . Even after the matching succeeds, a second checking is done using the friend ID that was hidden in the check flag. This friend ID is matched with all the friend IDs of the database and checked to see whether the corresponding e-mail is same as the e-mail hidden in the check flag. The method returns TRUE or FALSE depending on this matching result. processRequest() This method is used to process the subscription data and update the database thereby. It works as follows: . First it creates an array named $param with the form ID, friend e-mail, subscription status (sub or unsub), originator e-mail, and subscription time stamp. . Then the array is passed into the addSubscriptionData() method of the Form class to add the subscription data. . If the addition is successful and the subscription type is sub (which means the friend agreed to subscribe to the system), an e-mail is sent to the friend. . The e-mail to be sent to the friend is decided from the subscription message ID specified while setting up the form. This ID is retrieved using the Form class and then fed into the Message class to get its details. . At the end, the friend is shown a status message depending on the subscription data addition status. Creating a Tell-a-Friend Reporter Application This application, taf_reporter.php, is responsible for generating reports for the system. This application included on the CD-ROM in the ch13/apps directory. It implements the following functionalities: . Produces a report for form creator with subscription ratio and other details. . Produces a scorecard report for friend originator. These are the methods used by the application.

Leave a Reply