Refer-A-Friend

Although Purlem does not have a Refer-A-Friend system built into the system, it is easy to integrate one into your campaign. 

referafriend.php

<?php <br>session_start();<br>if($_GET['firstName']) {<br>   $_SESSION['firstName'] = $_GET['firstName'];<br>   $_SESSION['lastName'] = $_GET['lastName'];<br>   header('Location: referafriend.php');<br>}<br>?><br><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br><html xmlns="http://www.w3.org/1999/xhtml"><br><head><br><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><br><title>Refer-A-Friend</title><br><style type="text/css"><br><!--<br>body {<br>   background-color:#F4F4F4<br>}<br>.box {<br>   font-family: Arial, Helvetica, sans-serif;<br>   background-color: #FFF;<br>   margin-right: auto;<br>   margin-left: auto;<br>   border: 5px solid #CCC;<br>   width: 400px;<br>   padding-right: 20px;<br>   padding-left: 20px;<br>   padding-bottom: 20px;<br>}<br>.textbox {<br>   font-weight: bold;<br>   padding: 3px;<br>   width: 95%;<br>   border: 1px solid #999;<br>}<br>--><br></style><br></head><br><br><body><br><div><br>  <h3>Refer-A-Friend</h3><br>  <form id="form1" name="form1" method="get" action="http://purlapi.com/import/contact/index.php"><br>    <table width="400" border="0" cellspacing="0" cellpadding="3"><br>      <tr><br>        <td width="100">First Name:</td><br>        <td><input type="text" name="firstName" id="firstName"/></td><br>      </tr><br>      <tr><br>        <td>Last Name:</td><br>        <td><input type="text" name="lastName" id="lastName"/></td><br>      </tr><br>      <tr><br>        <td>Email:</td><br>        <td><input type="text" name="email" id="email"/></td><br>      </tr><br>      <tr><br>        <td>&nbsp;</td><br>        <td><br>          <input type="submit" name="button" id="button" value="Submit" /><br>          <input name="ID" type="hidden" id="ID" value="<Your User ID>" /><br>          <input name="token" type="hidden" id="token" value="<Your Token>" /><br>          <input name="campaignID" type="hidden" id="campaignID" value="<Your Campaign ID>" /><br>          <input name="return" type="hidden" id="return" value="<Your Website URL>/referafriend_thanks.php" /><br>          <input name="adminEmail" type="hidden" id="adminEmail" value="<Your Email (optional: to receive notification when form is submitted)>" /><br>          <input name="returnID" type="hidden" id="returnID" value="Y" /><br>        </td><br>      </tr><br>    </table><br>  </form><br></div><br></body><br></html>
	

referafriend_thanks.php

<?php <br>//******* PURL CODE - DO NOT EDIT ************<br>$curl = curl_init();curl_setopt ($curl, CURLOPT_URL, 'http://www.purlapi.com/lp/index.php?ID='.$_GET["ID"].'&name='.$_GET["name"].'&page='.$_GET["page"].'&conversionID='.$_REQUEST["conversionID"].'&test='.$_GET["test"].''); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $user = curl_exec ($curl); curl_close ($curl); $user = json_decode($user); session_start(); if($_GET['username']) $_SESSION['visitor']=$_GET['username']; if($user->{'login'} && ($_SESSION['visitor'] != $user->{'firstName'}.''.$user->{'lastName'})) { echo $user->{'login'}; exit; }<br>//******* END PURL CODE ************<br><br>session_start();<br><br>//begin email<br>$websiteURL = 'http://<YOUR WEBSITE URL>';<br>$to = $user->{'email'};<br>$subject = 'Check this out';<br>$message = '<p>'.$_SESSION['firstName'].' '.$_SESSION['lastName'].' recommends you visit your PURL: '.$websiteURL.'/'.$user->{'contact_purl1'}.'.'.$user->{'contact_purl2'}.'"</p>';<br><br>// To send HTML mail, the Content-type header must be set<br>$headers  = 'MIME-Version: 1.0' . "\r\n";<br>$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";<br><br>// Mail it<br>mail($to, $subject, $message, $headers);<br>//end email<br><br>?><br><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br><html xmlns="http://www.w3.org/1999/xhtml"><br><head><br><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><br><title>Refer-A-Friend</title><br><style type="text/css"><br><!--<br>body {<br>   background-color:#F4F4F4<br>}<br>.box {<br>   font-family: Arial, Helvetica, sans-serif;<br>   background-color: #FFF;<br>   margin-right: auto;<br>   margin-left: auto;<br>   border: 5px solid #CCC;<br>   width: 400px;<br>   padding-right: 20px;<br>   padding-left: 20px;<br>   padding-bottom: 20px;<br>}<br>.textbox {<br>   font-weight: bold;<br>   padding: 3px;<br>   width: 95%;<br>   border: 1px solid #999;<br>}<br>--><br></style><br></head><br><br><body><br><div><br>  <p><strong>Thanks <?php echo $_SESSION['firstName']; ?>.</strong> <br /><br>  Your referral has been sent.</p><br></div><br></body><br></html>