<?php
// Call in the Signup Library (signup_lib.php)
define('MOD_PHP', substr(PHP_SAPI, 0, 3) != 'cgi'); // Are we running as mod_php?
define('DOCROOT', 
	MOD_PHP && isset($_SERVER['DOCUMENT_ROOT']) ? 
		$_SERVER['DOCUMENT_ROOT'] : 
			(MOD_PHP && isset($_SERVER['SCRIPT_FILENAME']) ? 
				substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])) : 
				substr(str_repeat('../', count(explode('/', preg_replace('_/+_', '/', $_SERVER['PHP_SELF'])))-2), 0, -1))
	);
include(DOCROOT . '/dmx/edi/signup_lib.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Simple Signup Function (PHP)</title>
    <meta name="generator" content="BBEdit 8.5">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="Project" content="dmClubAutumn06">
    <meta name="Source" content="01">
    <meta name="Code" content="30">
    <meta name="Rel_Version" content="1.5.0-7">
    <meta name="Date" content="14-02-2007">
    <meta name="Copyright" content="Digital Mail Limited 2005-2007">
</head>

<body>

<h1>Simple Number Assignment Function</h1>

<?php if (isset($_GET['email'])) : ?>

<h3>Code</h3>

<pre>
&#60;?php
// Example use of 'simple_signup' function (for a new signup)
unset($params);
$params['dealer_id'] = '9222';                      // The dealer ID
$params['tariff']    = 'Public.EC-UK-PN-PN2-Entry'; // The tariff to try to sign up for
$params['email']     = '<?=$_GET['email'];?>';
$params['dob']       = '01/01/1990';                // Security data: Memorable date
$params['mmn']       = 'secret';                    // Security data: Memorable word
$result = simple_signup($params);
?&#62;
</pre>

<h3>$result is...</h3>

<?php
// Example use of 'simple_signup' function (for a new signup)
unset($params);
$params['dealer_id'] = '9222';                      // The dealer ID
$params['tariff']    = 'Public.EC-UK-PN-PN2-Entry'; // The tariff to try to sign up for
$params['email']     = $_GET['email'];              // The customer's email address
$params['dob']       = '01/01/1990';                // Security data: Memorable date
$params['mmn']       = 'secret';                    // Security data: Memorable word
$result = simple_signup($params);

// Display values in $result array
echo('<pre>' . print_r($result, 1) . '</pre>');
?>

<?php else : ?>

<form method="GET">
<p>
Enter customer's email address <input type="text" name="email" size="40">
</p>
</form>

<?php endif; ?>

</body>
</html>