这是一个install的服务器验证文档,因为我不懂PHP我想问下序列号在哪个位置添加.
<?php define('LICENSE_VALID', '601');
define('LICENSE_INVALID', '602'); if(isset($_POST['licenseid']) && trim($_POST['licenseid']) != '')
{
// variables posted by AI serial validation tool
$licenseid = trim($_POST['licenseid']);
$languageid = (int) $_POST['languageid']; // you can use this parameter to display a localized error message taken from your database
if($id == '555-555') // TODO: user custom database-linked code to check the license ID
{
echo LICENSE_VALID . "\n" . "Serial ID = " . $licenseid . ' is OK.';
die();
}
else
{
echo LICENSE_INVALID . "\n" . "Serial ID = " . $licenseid . ' is invalid !';
die();
}
}
else
{
echo LICENSE_INVALID . "\n" . "Missing Serial ID !";
die();
} ?>
代码的意思大概是什么意思.实在麻烦了...谢谢!!
<?php define('LICENSE_VALID', '601');
define('LICENSE_INVALID', '602'); if(isset($_POST['licenseid']) && trim($_POST['licenseid']) != '')
{
// variables posted by AI serial validation tool
$licenseid = trim($_POST['licenseid']);
$languageid = (int) $_POST['languageid']; // you can use this parameter to display a localized error message taken from your database
if($id == '555-555') // TODO: user custom database-linked code to check the license ID
{
echo LICENSE_VALID . "\n" . "Serial ID = " . $licenseid . ' is OK.';
die();
}
else
{
echo LICENSE_INVALID . "\n" . "Serial ID = " . $licenseid . ' is invalid !';
die();
}
}
else
{
echo LICENSE_INVALID . "\n" . "Missing Serial ID !";
die();
} ?>
代码的意思大概是什么意思.实在麻烦了...谢谢!!
是不是代码自身有问题?
LicenseID是通过表单提交过来的,
如果想让这个程序通过,就表单里提交'555-555',
把 if($id == '555-555') 里面的$id改成$licenseid。<?php define('LICENSE_VALID', '601'); //定义正确的LICENSE状态值
define('LICENSE_INVALID', '602'); //定义非法的LICENSE状态值if(isset($_POST['licenseid']) && trim($_POST['licenseid']) != '') //如果表单POST方式提交且提交的'licenseid'数据非空
{
// variables posted by AI serial validation tool
$licenseid = trim($_POST['licenseid']); // 截去$_POST['licenseid']首尾的空格
$languageid = (int) $_POST['languageid']; // you can use this parameter to display a localized error message taken from your database
if($id == '555-555') // TODO: user custom database-linked code to check the license ID
{//如果$id值为'555-555'则返回正确认证信息
echo LICENSE_VALID . "\n" . "Serial ID = " . $licenseid . ' is OK.';
die();
}
else
{ //否则返回错误信息
echo LICENSE_INVALID . "\n" . "Serial ID = " . $licenseid . ' is invalid !';
die();
}
}
else
{ //如果表单不是以POST方式提交或提交的'licenseid'数据为空,则返回错误信息
echo LICENSE_INVALID . "\n" . "Missing Serial ID !";
die();
} ?>