首页
社区
课程
招聘
[原创]PHP注册算法
发表于: 2013-5-7 07:38 7092

[原创]PHP注册算法

2013-5-7 07:38
7092

<?php
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);

// display warnings and errors
error_reporting(E_WARNING | E_ERROR);

?><?php
require_once('lib.inc.php');
$GLOBAL_SESSION=returnsession();
$common_html=returnsystemlang('common_html');
$html_etc=returnsystemlang('SERVERINFOR');
//SYSTEM_PRIV_CONTROL_MYDESKTOP("system_register.php","Value");

page_css('System Register');
//系统注册说明
print "<BR>";
$MACHINE_CODE = returnmachinecode();
table_begin();
print "<tr><td nowrap class=\"TableHeader\" colspan=2 width=20%>系统注册信息(System register information)</td></tr>";
table_end();
?>


<?php
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);

// display warnings and errors
error_reporting(E_WARNING | E_ERROR);

session_start();
header("Content-type:text/html;charset=gb2312");
require_once('lib.inc.php');

//$GLOBA_SESSION=returnsession();
//

$systemlang=$_SESSION['SUNSHINE_USER_LANG'];
if($systemlang=='')		$systemlang = 'zh';
if($systemlang=='zh')		{
	$register="注册";
	$returnText="返回";
	$registercodenotnull="注册码不能为空!";
	$paste="粘贴";
	$copy="复制";
	$machinecode_text="机器码";
	$registercode_text="注册码";
	$inputregistercode = "软件注册码输入";
}
else	{
	$register="Register";
	$returnText = "Cancel";
	$registercodenotnull="Register code not null";
	$paste="Paste";
	$copy="Copy";
	$machinecode_text="Machine code";
	$registercode_text="Register code";
	$inputregistercode = "Input software register code";
}
$LOGIN_THEME=$_SESSION['LOGIN_THEME'];
$LOGIN_THEME==""?$LOGIN_THEME=3:'';

?>
<html>
<head>
<title>注册页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<?php print "<LINK href=\"".ROOT_DIR."theme/$LOGIN_THEME/style.css\" type=text/css rel=stylesheet>";?>
<script Language="JavaScript">
function CheckForm()
{
   if(document.form2.REGISTER_CODE.value=="")
   { alert("<?php echo $registercodenotnull?>");
     return (false);
   }
   if(document.form2.SERVER_NAME.value=="")
   { alert("注册域名不能为空!请填写您所在使用服务器的域名!");
     return (false);
   }
   if(document.form2.SCHOOL_NAME.value=="")
   { alert("单位名称不能为空,请填写您所在单位的全称!");
     return (false);
   }
   return (true);
}

function copy_code()
{
  textRange = document.form2.MACHINE_CODE.createTextRange();
  textRange.execCommand("Copy");
}

function paste_code()
{
  textRange = document.form2.REGISTER_CODE.createTextRange();
  textRange.execCommand("paste");
}

</script>
</head>
<script type="text/javascript" language="javascript" src="../Enginee/lib/common.js"></script>
<body class="bodycolor" topmargin="5" onload="document.form2.REGISTER_CODE.focus();">

<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Small"><span class="Small3"><font color=black><B>注册页面</B></font></span><br>
    </td>
  </tr>
</table>

<hr width="95%" height="1" align="left" class="Small1">

<div align="center" class="Small1">
<b>

<?php
$code=returnmachinecode();
//print $code;
$ini_file=@parse_ini_file('license.ini');

?>

<form action="register_submit.php" method="post" name="form2" onsubmit="return CheckForm();">
<table class="TableBlock" align="center" width="500">
<tr class="TableHeader">
<td colspan=2><?php echo $inputregistercode?></td>
</tr>
<tr class="TableData">
<td ><?php echo $machinecode_text?>:</td>
<td ><input type="text" name="MACHINE_CODE" size="20" class="SmallStatic" value="<?php echo $code?>" readonly>
 <input type="button" value="<?php echo $copy?>" class="SmallButton" onclick="copy_code()"></td>
</tr>
<tr class="TableData">
<td width=35%><?php echo $registercode_text?>:</td>
<td ><input type="text" name="REGISTER_CODE" size="20" class="SmallInput" value="<?php echo $ini_file['REGISTER_CODE']?>">
 <input type="button" value="<?php echo $paste?>" class="SmallButton" onclick="paste_code()">
 <BR>(注册码需要联系软件开发商获取,<a href='http://www.pediy.com' target=_blank>访问开发者网站</a>)
 </td>
</tr>

<tr class="TableData">
<td width=35%>注册域名:</td>
<td ><input type="text" name="SERVER_NAME" size="38" class="SmallInput" value="<?php echo $ini_file['SERVER_NAME']?>"><BR>(正在使用的OA的域名,如:www.pediy.com)
 </td>
</tr>


<tr class="TableData">
<td width=35%>单位名称:</td>
<td ><input type="text" name="SCHOOL_NAME" size="38" class="SmallInput" value="<?php echo $ini_file['SCHOOL_NAME']?>">
<BR>(单位名称的全称,如NeiTe开发)
 </td>
</tr>


<TR align=middle><TD class=TableControl noWrap align=middle  colspan="32">
<div align="middle">
<input type="submit" value=" <?php echo $register?> " class="SmallButton">
<input type=button accesskey="c" value=" <?php echo $returnText?> " class=SmallButton onClick="history.back();" title="<?php echo $returnText?>">
 </div>
</TD></TR>
</table>
 </form>
 </font>
</b>
</div>

<br><br>

</body>
</html>




<?php
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);

// display warnings and errors
error_reporting(E_WARNING | E_ERROR);


require_once('../include.inc.php');
//
$GLOBAL_SESSION=returnsession();
$common_html=returnsystemlang('common_html');
//print_R($_GET);
//print_R($_POST);
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">
<LINK href=\"../../../theme/9/style.css\" rel=stylesheet>";
$_POST['MACHINE_CODE']==''?exit:'';
//print $_POST['MACHINE_CODE']."<br>";
$machinecode=machinecode_sunshine_512_2000($_POST['MACHINE_CODE']);
//print $machinecode."<br>";
//print $_POST['REGISTER_CODE'];
if($machinecode==$_POST['REGISTER_CODE'])		{
	$filename='license.ini';
	@unlink($filename);
	$somecontent="[section]\n MACHINE_CODE=".$_POST['MACHINE_CODE']."\n REGISTER_CODE=".$_POST['REGISTER_CODE']."\n SERVER_NAME=".$_POST['SERVER_NAME']."\n SCHOOL_NAME=".$_POST['SCHOOL_NAME']."";
	@!$handle = fopen($filename, 'w');
	if (!fwrite($handle, $somecontent)) {
		exit;
	}
	fclose($handle);
	page_css('Register');
	$common_text['zh']='注册成功!';
	$common_text['en']='Register successful!';
	require_once('../Enginee/newai_executesql.php');
	returnRegisterExpireUserNumber();
	print_infor($common_text[$systemlang],'trip',"location='register.php'");
	//print "<div align=center><input type=button class=SmallButton value='返回' onClick=\"location='register.php'\" /></div>";
}
else		{
	$common_text['zh']='注册失败!';
	$common_text['en']='Register failed!';
	page_css('Register');
	print_infor($common_text[$systemlang],'trip',"location='register.php'");
	//print "<div align=center><input type=button class=SmallButton value='返回' onClick=\"location='register.php'\" /></div>";
}


?>


[section]
 MACHINE_CODE=28dc9ab21fea
 REGISTER_CODE=8aeb609af581
 SERVER_NAME=localhost
 SCHOOL_NAME=NeiTe

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 6
支持
分享
最新回复 (8)
雪    币: 44229
活跃值: (19950)
能力值: (RANK:350 )
在线值:
发帖
回帖
粉丝
2
neite对php有研究?有时间的话,帮论坛开发一些小插件,呵~
2013-5-7 10:21
0
雪    币: 707
活跃值: (1301)
能力值: ( LV9,RANK:190 )
在线值:
发帖
回帖
粉丝
3
不错!。。。。。。
2013-5-7 10:40
0
雪    币: 1626
活跃值: (138)
能力值: ( LV4,RANK:40 )
在线值:
发帖
回帖
粉丝
4
可以,需求M我呢。时间安排得过来,抽点时间写写
2013-5-7 11:05
0
雪    币: 141
活跃值: (318)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
可以。。。。。。。。!
2013-5-7 11:21
0
雪    币: 508
活跃值: (89)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
6
恭喜~~终于觅得贤才
2013-5-7 13:36
0
雪    币: 406
活跃值: (164)
能力值: ( LV12,RANK:250 )
在线值:
发帖
回帖
粉丝
7
注册算法没帖出来,只帖了HTML代码和一些过程判断的语句。
2013-5-8 00:25
0
雪    币: 14
活跃值: (12)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
弱弱的说一句:我只看到js,没看到php啊
2013-5-8 01:04
0
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
看不懂php的菜鸟留个脚印
2013-6-4 16:33
0
游客
登录 | 注册 方可回帖
返回
//