<?php

//启用某个序列号
if( isset($_GET['key']) )
{ 
 $licensekey = $_GET['key'];    
}

//连接MySQL
$conn = @mysql_connect("localhost", "gili0512", "Jg4GS97gWVSw");

if($conn == FALSE){	
	print_r("failed to connect!");
	exit;
}

//选择数据库
mysql_select_db("gili0512_usb_stick_encryption");

//执行SQL
$result = @mysql_query("SELECT * FROM licenseinfo where RegCode='$licensekey'");



if(mysql_num_rows($result) > 0)
{
  While($row = mysql_fetch_array($result))
  {
    // print_r($row["id"].",".$row["RegCode"].",".$row["Activations"].",".$row["IsExpired"]);
     //print_r("<br />");
     $Expired=0;
     $RegCode=$row["RegCode"];
     //print_r($Activations);
     
     $result = mysql_query("UPDATE licenseinfo SET IsExpired = '$Expired' WHERE RegCode = '$RegCode' ");
     if(mysql_affected_rows() > 0)
     {
       print_r("Live");
     } 
  }
}
else
{
  print_r("not found！");

}

//释放结果集
mysql_free_result($result);

//关闭连接
mysql_close();


?> 
