<?php
foreach($_GET as $key=>$val) { // read get request from web
$SN = $val;
}
$servername = ""; //connect db
$username = "";
$password = "";
$dbname = "";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `device` WHERE `SN` = '$SN'";
// echo ($sql);
if(!mysqli_query($conn, $sql))
{
die('Error : ' . mysqli_error($conn));
}
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output db
while($row = $result->fetch_assoc()) {
$TAG = $row["TAG"];
$TIME = $row["TIME"];
$NOTE = $row["NOTE"];
$N1 = $row["N1"];
$N2= $row["N2"];
echo"<body>";
echo"<div style='text-align: center'>";
echo"<h1>";
print ("Wellcome to FKUN QR Service");
echo"</h1>";
echo"</br>";
echo"<div style='border: 5px solid;'>";
echo"<p style='font-size: 5vw; text-align: left; margin-left: 10%; width:80%;'>";
print ("SN:".$SN);
echo"</br>";
print ("TAG:".$TAG);
echo"</br>";
if($TIME != NULL){
print ("Date:".$TIME);
}else{
print ("Date:Unknow");
}
if($NOTE != NULL){
echo"</br>";
print ("INFO:");
echo"<p style='font-size: 4vw; text-align: left; margin-left: 10%; width:80%; height: 30%; border: 5px inset;'>";
print ($NOTE);
echo"</p>";
}else{
}
if($N1 != NULL){
echo"</br>";
echo"<p style='font-size: 3vw; text-align: left; margin-left: 10%; width:80%; border: 5px inset;'>";
print ($N1);
echo"</p>";
}else{
}
if($N2 != NULL){
echo"</br>";
echo"<p style='font-size: 3vw; text-align: left; margin-left: 10%; width:80%; border: 5px inset;'>";
print ($N2);
echo"</p>";
}else{
}
echo"</p>";
echo"</div>";
echo"</div>";
echo"</body>";
}
} else {
echo "Not Found";
}
$conn->close();
?>
数字化资产管理的后端源码
FKUN<?php foreach($_GET ...
请注意,本文编写于 1198 天前,最后修改于 1198 天前,其中某些信息可能已经过气。
现在这个代码在 PHP8.3 已经无法使用了,希望能够及时适配。
近期有空处理下
刚刚经过测试8.3应该没有问题,可以截图到论坛看下具体是什么报错。