<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
error_reporting(0);
ini_set('html_errors',false);
ini_set('display_errors',false);
include("captcha.function.php");

session_start();

// Change this to your real email address:
$myemail = 'me@mysite.com';

// Initialising the $error variable. At the start it is 0. Each field in this form is processed, and if something is wrong (empty input, wrong email address, invalid captcha code, etc) $error is incremented. Form will stop processing if $error is > 0.
$error = 0;
$name_text = 'Please enter your code';
$name = '';
$email_text = 'Please enter you email';
$email = '';
$captcha_text = 'Please tell me you\'re not a spambot';

// This piece of code decides whether to show the form or to process it
if (!isset($_POST['action']) || $_POST['action'] != 'submit') {
	show_form();
	die;
}

// Ok, let's process the form
else {
	// Checking name
	if (empty($_POST['code'])) {
		$error .= 1;
		Msgbox("Please enter your code");
	} else {
		$error  .= 0;
		// Please note, that in 'real life' you have to do something like this with user's data: mysql_real_escape_string(strip_tags(trim($_POST['name'])));
		$name = strip_tags($_POST['code']);
	}
	
	// Checking email
	if (empty($_POST['email'])) {
		$error .= 1;
		Msgbox("Please enter your email");
		$email_text = '<span>Please enter your email</span>';
	} elseif (!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_a-z{|}~]+\.'.'[-!#$%&\'*+\\.\/0-9=?A-Z^_a-z{|}~]+$/i', $_POST['email'])) {
		$error .= 1;
		Msgbox("Please enter correct email address");
		$email = strip_tags($_POST['email']);
	} else {
		$error .= 0;
		$email = strip_tags($_POST['email']);
	}
	

	// Now let's check The CAPTCHA
	if (!captcha_verify_word()) {
		$error .= 1;
		Msgbox("Wrong image captcha code");
		$captcha_text = '<span>Wrong image code</span>';
	} else {
		$error .= 0;
	}
	
	// If $error is > 0, we'll show the form again
	if ($error > 0) {
		show_form();
		die;
	} else {
		// If everything is ok, we'll send an email
		$code = strip_tags(trim($_POST['code']));
		$email = strip_tags(trim($_POST['email']));
    $url = "http://ktweibo.sinaapp.com/imapbox_english_keygen.php?code=".$code."&email=".$email; 
    $contents = file_get_contents($url); 
    
		//判断contents值并跳转到显示序列号的页面。
		if($contents == "0" || $contents == "" || strlen($contents) < 64){
			msgbox("The Code your input incorrect,please check your email again or contact us..");
			show_form();
		}else{
			show_success($contents);
			}
		die();
	}
}

function MsgBox($str){     
	echo("<script language=javascript>") ;    
	echo ("alert('$str');");                
	echo("</script>");   
	}
// This function shows the form
function show_form() {
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="order.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.order_Div1 {width:230px; float:left; border:1px solid #999999; border-right:0px; height:330px; margin-top:40px; text-align:center; background:url(images/order-bg1.jpg) repeat-y #f7f7ef right top;}
.order_Div12 {width:230px; float:left; border:1px solid #009900; border-right:0px; height:330px; margin-top:40px; text-align:center; background:url(images/order-bg1.jpg) repeat-y #f7f7ef right top;}
.order_Div2 {width:300px; float:left; border:3px solid #CC9966; height:380px; text-align:center; background-color:#ffffff; font-family:Arial, Helvetica, sans-serif;}
.order_Div22 { width:300px; float:left; border:3px solid #009900; height:380px; text-align:center; background-color:#F4FFFF; font-family:Arial, Helvetica, sans-serif;}
.order_Div3 {width:230px; float:left; border:1px solid #999999; border-left:0px; height:330px; margin-top:40px; text-align:center; background:url(images/order-bg2.jpg) repeat-y #f7f7ef left top;}
.order_Div32 {width:230px; float:left; border:1px solid #009900; border-left:0px; height:330px; margin-top:40px; text-align:center; background:url(images/order-bg2.jpg) repeat-y #f7f7ef left top;}
.order_Div4 { border:1px solid #999999;width:414px; PADding:10px; text-align:center; background:url(images/serial.jpg) 10px 35px no-repeat; PADding-left:340px;}
.order_Div42 { border:1px solid #009900;width:414px; PADding:10px; text-align:center; background:url(images/serial.jpg) 10px 35px no-repeat; PADding-left:340px;}
#myform { padding: 1%; }
#myform div { margin-bottom: 0.5em; }
#myform span { color: #FF0000; font-weight: 700; }
#myform input { border: 1px solid #CCCCCC; padding: 0.2em; background-color: #F9FDFF; }
#myform textarea { border: 1px solid #CCCCCC; padding: 0.2em; background-color: #F9FDFF; }
#myform button { border: 1px solid; background-color: #3366CC; color: #FFFFEE; border-left-color: #6DBFFF; border-top-color: #6DBFFF; border-bottom-color: #0C3F67; border-right-color: #0C3F67; }
-->
</style>
</head>

<body>


<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="generate">
	<input type="hidden" name="action" value="submit">
<div id="body-min">
  <div style="PADding:0px 30px 0px 20px;">
  	<div style="background:url(images/security.gif) no-repeat; width:760px; margin:0 auto; height:90px; text-align:center;">
	
  	  <h1 style="text-align:center; font-size:32px; line-height:40px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#333333; PADding-bottom:13px;">Get Your iMapBox <font color=red>Serial Code</font> Now</h1>
  	  <p style="text-align:center; font-size:18px; color:#999999;">Your iMapBox Serial Code Generated immediately.</p>
  	</div>
    <div style="width:780px; margin:0 auto;">
      <div class="ClearAll"></div>
      <br />
      <div class="order_Div4" onmouseover="this.className='order_Div42'" onmouseout="this.className='order_Div4'">
        <p style="font-size:35px; font-weight:bold; PADding-top:15px; color:#333333;">iMapBox <span style="font-size:14px; font-weight:bold; color:#99CC00; ">SERIAL CODE GENERATER. </span></p>
        <p style="font-size:18px; PADding-top:12px; color:#999999;" align="left"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Already Paid? </p>
         <p style="font-size:12px; PADding-top:12px; color:#999999;" align="left"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Code Sample: 8e4BOK1JRAo1EFmlBkFhAlGAlr5xJvfu </p>
         <p style="font-size:30px; PADding-top:16px; PADding-bottom:10px; color:#FF6633; font-weight:bold;"><input style="height: 40px; text-indent: 10px; border: 3px solid #bbbbbb; background: #feffa0; line-height: 40px; width: 280px;" id="code" name="code" type="text" maxlength="40" value="Paste your 32bit paid code (in your mailbox)" onclick="if (value =='Paste your 32bit paid code (in your mailbox)'){value =''}" onblur="if (value ==''){value='Paste your 32bit paid code (in your mailbox)'}"/></p>
         <p style="font-size:30px; PADding-top:16px; PADding-bottom:10px; color:#FF6633; font-weight:bold;"><input style="height: 40px; text-indent: 10px; border: 3px solid #bbbbbb; background: #feffa0; line-height: 40px; width: 280px;" id="email" name="email" type="text" maxlength="40" value="Enter your primary email account ..." onclick="if (value =='Enter your primary email account ...'){value =''}" onblur="if (value ==''){value='Enter your primary email account ...'}"/></p>
        <br>
        <div><?php echo $GLOBALS['captcha_text']; ?><br>
<img src="captcha.image.php?nocache=<?php echo md5(time()); ?>" border="0"><br><br>
<input name="magicword" style="height: 20px; text-indent: 10px; border: 3px solid #bbbbbb; background: #feffa0; line-height: 20px; width: 280px;" type="text" tabindex="4">
</div>
<div>Please fill in all the fields and press the button below</div>
<p style="border-bottom:1px dashed #999999; PADding:5px;"></p>
        <p style="font-size:18px; PADding:6px; font-weight:bold; color:#FF6633;">Ensure your email input correct</p>
        <p style="font-size:12px; color:#999999;"> serial number generated by your mail account  </p>
         <p style="font-size:12px; color:#999999; PADding-bottom:10px;"><font color="#FF6633"><b>Click Button build your Serial Code now!</b></font></p>
         <br> 
        <p><a href="#"><input type="image" src="images/generate.jpg" width="246" height="70" border="0" onmouseover="this.src='images/generate_hover.jpg'" onmouseout="this.src='images/generate.jpg'"/></p>
         
           <br>
        <p style="font-size:12px; color:#999999; PADding-top:10px;">When you click "Generate Serial Code" button,you will get product serial code in this page. and meantime,you will get serial code in your mailbox!</p>
        <br>
        <p style="font-size:12px; color:#ff0000;text-decoration:underline; PADding-bottom:10px;"><font color="blue"><b><a href="mailto:support@imapbox.com"><font color=red>Having trouble for Generate Serial Code? <br>Mail to Us, Will Reply in few Minute!</font></a></b></font></p>
      </div>

      </div>
    <div style="color: #666666; margin:0 auto; width:780px; margin-top:20px;">
			<p><strong>Note: </strong><br />
	  </p>
			<p>When you click &quot;<strong>Buy Now</strong>&quot;, you will be directed to Regnow who sells our products. After completing your payment you should click the &quot;<strong>Complete Secure Order</strong>&quot; to get your paid code.</p>
			<br />
			<p align="center"><span style="color: #666666"><a href="order.html" target="_self"><img src="images/buy-now.gif" alt="payment methods" width="170" height="34" border="0"/></a></p>
			<br />
			<p align="center"><span style="color: #666666"><img src="images/cc.gif" alt="payment methods" width="419" height="28" /><br />
&nbsp; &nbsp;(We also accept Bravo, EuroCard, JCB, Novus, MasterDebit and VisaDebit)</span></p>
			<p style="border-bottom:1px dashed #CCCCCC; margin-top:20px; margin-bottom:20px;"></p>
			<p><img alt="encrypt" height="15" src="images/encrypt.gif" width="12" /> <strong>Your online order is 100% SAFE and SECURE!</strong><br />
			Regnow sells our products - they are a trusted online retailer specializing in digitally delivered products. All your information remains private and secure. We guarantee the safety and protection of your personal information.</p>
			<br />
			<p>
				<img alt="money back guarantee" height="15" src="images/guarantee.jpg" width="13" /><strong> Is my purchase guaranteed?</strong><br />
				A: Absolutely! All orders are backed by our unconditional 30-day money back guarantee.If you are unhappy with your purchase, for any reason, simply contact us via e-mail for a full refund.<br />
	  </p>
			<br />
			<p><strong>Order IMAPBOX now, completely Risk-Free!</strong></p>
			<br />
			<p>
				<img alt="privacy protected" height="44" src="images/privacy1.gif" width="154" />&nbsp;&nbsp; <img alt="secure order" height="31" src="images/secure.gif" width="88" /></p>
    </div>
    <br />
  </div>
</div>
</form>
</body>
</html>
<?php
}
?>

<?php
function show_success($serial) {
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="order.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.order_Div1 {width:230px; float:left; border:1px solid #999999; border-right:0px; height:330px; margin-top:40px; text-align:center; background:url(images/order-bg1.jpg) repeat-y #f7f7ef right top;}
.order_Div12 {width:230px; float:left; border:1px solid #009900; border-right:0px; height:330px; margin-top:40px; text-align:center; background:url(images/order-bg1.jpg) repeat-y #f7f7ef right top;}
.order_Div2 {width:300px; float:left; border:3px solid #CC9966; height:380px; text-align:center; background-color:#ffffff; font-family:Arial, Helvetica, sans-serif;}
.order_Div22 { width:300px; float:left; border:3px solid #009900; height:380px; text-align:center; background-color:#F4FFFF; font-family:Arial, Helvetica, sans-serif;}
.order_Div3 {width:230px; float:left; border:1px solid #999999; border-left:0px; height:330px; margin-top:40px; text-align:center; background:url(images/order-bg2.jpg) repeat-y #f7f7ef left top;}
.order_Div32 {width:230px; float:left; border:1px solid #009900; border-left:0px; height:330px; margin-top:40px; text-align:center; background:url(images/order-bg2.jpg) repeat-y #f7f7ef left top;}
.order_Div4 { border:1px solid #999999;width:414px; PADding:10px; text-align:center; background:url(images/serial.jpg) 10px 35px no-repeat; PADding-left:340px;}
.order_Div42 { border:1px solid #009900;width:414px; PADding:10px; text-align:center; background:url(images/serial.jpg) 10px 35px no-repeat; PADding-left:340px;}
#myform { padding: 1%; }
#myform div { margin-bottom: 0.5em; }
#myform span { color: #FF0000; font-weight: 700; }
#myform input { border: 1px solid #CCCCCC; padding: 0.2em; background-color: #F9FDFF; }
#myform textarea { border: 1px solid #CCCCCC; padding: 0.2em; background-color: #F9FDFF; }
#myform button { border: 1px solid; background-color: #3366CC; color: #FFFFEE; border-left-color: #6DBFFF; border-top-color: #6DBFFF; border-bottom-color: #0C3F67; border-right-color: #0C3F67; }
-->
</style>
</head>

<body>



	
<div id="body-min">
  <div style="PADding:0px 30px 0px 20px;">
  	<div style="background:url(images/security.gif) no-repeat; width:760px; margin:0 auto; height:90px; text-align:center;">
	
  	  <h1 style="text-align:center; font-size:32px; line-height:40px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#333333; PADding-bottom:13px;">Your iMapBox <font color=red>Serial Code</font> Generated!</h1>
  	  <p style="text-align:center; font-size:18px; color:#999999;">Generated Success! Congratulation! Copy and Keep it!</p>
  	</div>
    <div style="width:780px; margin:0 auto;">
      <div class="ClearAll"></div>
      <br />
      <div class="order_Div4" onmouseover="this.className='order_Div42'" onmouseout="this.className='order_Div4'">
        <p style="font-size:35px; font-weight:bold; PADding-top:15px; color:#333333;">SUCCESS <span style="font-size:14px; font-weight:bold; color:#99CC00; "> COPY SERIAL CODE NOW. </span></p>
        <p style="font-size:18px; PADding-top:12px; color:#999999;" align="left"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Paste to your iMapBox dialog to register!</p>
         <p style="font-size:12px; PADding-top:12px; color:#999999;" align="left"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SERIAL CODE TEXTAREA:</p>
         <p style="font-size:30px; PADding-top:16px; PADding-bottom:10px; color:#FF6633; font-weight:bold;"><textarea style="height: 240px; text-indent: 10px; border: 3px solid #bbbbbb; background: #feffa0; line-height: 20px; width: 340px;overflow:hidden" id="serial" name="serial" type="text" maxlength="400"/><?php echo $serial;?></textarea></></p>
        
        <br>
<p style="border-bottom:1px dashed #999999; PADding:5px;"></p>
        <p style="font-size:18px; PADding:6px; font-weight:bold; color:#FF6633;">Serial Code also send to your mailbox!</p>
        <p style="font-size:12px; color:#999999;"> you can go to mailbox service webpage to check it out </p>
         <p style="font-size:12px; color:#999999; PADding-bottom:10px;"><font color="#FF6633"><b>Check it out in your email-inbox or trash-box!</b></font></p>
         <br> 
           <br>
        <p style="font-size:12px; color:#999999; PADding-top:10px;">Open you iMapBox and click menu-bar "HELP" -> "REGISTRATION ACTIVATION IMAPBOX", Copy and Paste your serial code to Serial code Textarea. Click "Activation" button to finish Activation!</p>
        <br>
        <p style="font-size:12px; color:#ff0000;text-decoration:underline; PADding-bottom:10px;"><font color="blue"><b><a href="mailto:support@imapbox.com"><font color=red>Having trouble for Activation Serial Code? <br>Mail to Us, Will Reply in few Minute!</font></a></b></font></p>
      </div>

      </div>
    <div style="color: #666666; margin:0 auto; width:780px; margin-top:20px;">
			<p><strong>Note: </strong><br />
	  </p>
			<p>When you click &quot;<strong>Buy Now</strong>&quot;, you will be directed to Regnow who sells our products. After completing your payment you should click the &quot;<strong>Complete Secure Order</strong>&quot; to get your paid code.</p>
			<br />
			<p align="center"><span style="color: #666666"><a href="order.html" target="_self"><img src="images/buy-now.gif" alt="payment methods" width="170" height="34" border="0"/></a></p>
			<br />
			<p align="center"><span style="color: #666666"><img src="images/cc.gif" alt="payment methods" width="419" height="28" /><br />
&nbsp; &nbsp;(We also accept Bravo, EuroCard, JCB, Novus, MasterDebit and VisaDebit)</span></p>
			<p style="border-bottom:1px dashed #CCCCCC; margin-top:20px; margin-bottom:20px;"></p>
			<p><img alt="encrypt" height="15" src="images/encrypt.gif" width="12" /> <strong>Your online order is 100% SAFE and SECURE!</strong><br />
			Regnow sells our products - they are a trusted online retailer specializing in digitally delivered products. All your information remains private and secure. We guarantee the safety and protection of your personal information.</p>
			<br />
			<p>
				<img alt="money back guarantee" height="15" src="images/guarantee.jpg" width="13" /><strong> Is my purchase guaranteed?</strong><br />
				A: Absolutely! All orders are backed by our unconditional 30-day money back guarantee.If you are unhappy with your purchase, for any reason, simply contact us via e-mail for a full refund.<br />
	  </p>
			<br />
			<p><strong>Order IMAPBOX now, completely Risk-Free!</strong></p>
			<br />
			<p>
				<img alt="privacy protected" height="44" src="images/privacy1.gif" width="154" />&nbsp;&nbsp; <img alt="secure order" height="31" src="images/secure.gif" width="88" /></p>
    </div>
    <br />
  </div>
</div>
</body>
</html>
<?php
}
?>