代码拉取完成,页面将自动刷新
<?php
extract($_POST);
extract($_GET);
unset($_POST,$_GET);
if (isset($ip) && isset($kid)){
$ip=trim($ip);
$kid=trim($kid);
$servername="DRIVER={SQL Server};SERVER=10.100.160.176;DATABASE=ReportServer";
$conn=odbc_connect($servername,'thtfmes',"Mes&thtf",SQL_CUR_USE_ODBC);
if ($conn){
$sql1="SELECT Name FROM Master..SysDatabases";
$exec1=odbc_exec($conn, $sql1);
while(odbc_fetch_row($exec1)){
$sql=" SELECT ProductKeyID, ProductKeyState, ProductKey
FROM ".odbc_result($exec1,"Name").".dbo.ProductKeyInfo
WHERE (ProductKeyID = '$kid')";
$exec=odbc_exec($conn, $sql);
while(odbc_fetch_row($exec))
{
print '<strong>Product Key ID: </strong><font color="red">'.odbc_result($exec,"ProductKeyID").'</font><br \>';
print '<strong>Key State: </strong><font color="red">'.odbc_result($exec,"ProductKeyState").'</font><br \>';
print '<strong>Product Key: </strong><font color="red">'.odbc_result($exec,"ProductKey").'</font><br \><br \>';
odbc_close($conn);
die("MDOS Server---".date("Y-m-d H:i:s"));
}
}
}
// finding in new server
$servername="DRIVER={SQL Server};SERVER=$ip;DATABASE=SmartClient";
$conn=odbc_connect($servername,'thtfmes',"Mes&thtf",SQL_CUR_USE_ODBC);
if ($conn){
$sql="SELECT dbo.ProductKeyInfo.ProductKeyID,dbo.ProductKey.ProductKeyState
FROM dbo.ProductKey INNER JOIN
dbo.ProductKeyInfo ON dbo.ProductKey.ProductKeyID = dbo.ProductKeyInfo.ProductKeyID
WHERE (dbo.ProductKey.MSFTProductKeyID = '$kid')";
$exec=odbc_exec($conn, $sql);
if(odbc_fetch_row($exec)){
print '<strong>Product Key ID: </strong>'.odbc_result($exec, "ProductKeyID").'<br \>';
print '<strong>Key State: </strong><font color="red">'.odbc_result($exec, "ProductKeyState").'</font><br \>';
odbc_close($conn);
die("MSC Server---".date("Y-m-d H:i:s"));
}else{
$sql="SELECT dbo.ProductKey.ProductKeyID,dbo.ProductKey.ProductKeyState
FROM dbo.ProductKey WHERE dbo.ProductKey.MSFTProductKeyID = '$kid'";
$exec=odbc_exec($conn, $sql);
if(odbc_fetch_row($exec)){
print '<strong>Product Key ID: </strong>'.odbc_result($exec, "ProductKeyID").'<br \>';
print '<strong>Key State: </strong><font color="red">'.odbc_result($exec, "ProductKeyState").'</font><br \>';
odbc_close($conn);
die("MSC Server---".date("Y-m-d H:i:s"));
}
}
}
echo "[ERROR]: No KeyID was found";
odbc_close($conn);
}else{
echo "[ERROR]: information issue";
echo "ip=$ip";
echo "act=$act";
echo "kid=$kid";
echo "isNew=$isNew";
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。