Skip to content

Instantly share code, notes, and snippets.

Created January 4, 2013 20:06
Show Gist options
  • Save anonymous/4455522 to your computer and use it in GitHub Desktop.
Save anonymous/4455522 to your computer and use it in GitHub Desktop.
Link HREF for in email
http://davidfarr.com/click/all-night-graduation-parties.php?Email1=%$email$%&Name=%$name$%&Company=%$company$%&Workphone=%$workphone$%&Homephone=%$homephone$%&City=%$city$%&field9=%$custom:field9$%&field2=%$custom:field2$%
<?php
/***
* Some Basic Settings. Remember to remove the square brackets ie [ and ]
*/
$merchant_id = '5734';
$autoresponder_id = '723948';
$thank_you_url = 'http://davidfarr.com/e-promo-kits/all-night-graduation-parties/.php';
$tracker_short_name = 'tracker';
$system_notification = '0'; /* Use 0 (zero) for NO and 1 (one) for YES. This is "New Subscriber" notification email. */
$page_title = "Forwarding..."; /* defines a title in the browser toolbar */
/***
* Primary functions to set cookies
*/
$client_email = $_GET[email];
$auto=$_GET['auto'];
if ( isset ($_COOKIE[linktracker]) ) {
$increaseBy = 1 ;
$newCount = $increaseBy + $_COOKIE[linktracker];
$number_of_days = 600 ;
$date_of_expiry = time() + 60 * 60 * 24 * $number_of_days ;
setcookie( 'linktracker', $newCount, $date_of_expiry, '/' ) ;
} else if ( !isset ( $_GET[count] ) ) {
$newCount = '1';
$number_of_days = 600 ;
$date_of_expiry = time() + 60 * 60 * 24 * $number_of_days ;
setcookie( 'linktracker', $newCount, $date_of_expiry, '/' ) ;
} else if ( ctype_digit( $_GET[count] ) ) {
$newCount = $_GET[count] + 1;
$number_of_days = 600 ;
$date_of_expiry = time() + 60 * 60 * 24 * $number_of_days ;
setcookie( 'linktracker', $newCount, $date_of_expiry, '/' ) ;
} else {
$newCount = '1';
$number_of_days = 600 ;
$date_of_expiry = time() + 60 * 60 * 24 * $number_of_days ;
setcookie( 'linktracker', $newCount, $date_of_expiry, '/' ) ;
};
/***
* Destroy GET array to prep for extra fields
*/
unset($_GET['email']);
unset($_GET['count']);
unset($_GET['auto']);
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php echo $page_title; ?></title>
<meta name="viewport" content="width=device-width">
</head>
<body>
<div role="main">
<form name="form1" id="form1" method="post" action="https://www.mcssl.com/app/contactsave.asp">
<input name="merchantid" type="hidden" id="merchantid" value="<?php echo $merchant_id; ?>">
<input name="ARThankyouURL" type="hidden" id="ARThankyouURL" value="<?php echo $thank_you_url; ?>">
<input name="copyarresponse" type="hidden" id="copyarresponse" value="<?php echo $system_notification; ?>">
<input name="defaultar" type="hidden" id="defaultar" value="<?php echo $autoresponder_id; ?>">
<input name="allowmulti" type="hidden" id="allowmulti" value="0">
<input name="visiblefields" type="hidden" id="visiblefields" value="">
<input name="requiredfields" type="hidden" id="requiredfields" value="">
<input name="Email1" type="hidden" id="Email1" value="<?php echo $client_email; ?>">
<input id="<?php echo $tracker_short_name; ?>" name="<?php echo $tracker_short_name; ?>" type="hidden" value="<?php echo $newCount; ?>" />
<?php
foreach ($_GET as $key => $value) {
echo '<input id="' . $key . '" name="' . $key . '" type="hidden" value="' . $value . '" />';
}
?>
<?php if ($auto == 'yes') echo '<noscript>'; ?>
<p>If you are not automatically forwarded, please <input type="submit" name="cmdSubmit" id="cmdSubmit" value="CLICK HERE" class="text_button"></p>
<?php if ($auto == 'yes') echo '</noscript>'; ?>
</form>
</div>
<?php if ($auto == 'yes') echo '<script type="text/javascript">document.getElementById("form1").submit();</script>'; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment