【发布时间】:2018-07-02 02:14:51
【问题描述】:
任何能够帮助解决这个烦人的错误的人都尝试了大约 30 分钟。
<?php
if(isset($_POST['statusBtn']))
{
$username = htmlspecialchars($_POST['address']);
strtolower($username);
if(empty($username))
{
echo '<center><div class="alert alert-icon alert-danger alert-dismissible fade in col-md-7" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span></button><i class="mdi mdi-check-all"></i>Fill in all fields</div></center>';
} else if($username == "" || $username == ""){
echo '<center><div class="alert alert-icon alert-danger alert-dismissible fade in col-md-7" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><i class="mdi mdi-check-all"></i>Domain Whitelisted</div></center>';
} else {
$geo = @file_get_contents("http://ip-api.com/json/{$username}");
$json_a = json_decode($geo, true);
$proxyid = $json_a['status'];
if($proxyid == success)
{
echo '<center><div class="alert alert-icon alert-success alert-dismissible fade in col-md-7" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><i class="mdi mdi-check-all"></i>'.htmlspecialchars($username).' is Online!</div></center>';
} else {
echo '<center><div class="alert alert-icon alert-danger alert-dismissible fade in col-md-7" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><i class="mdi mdi-check-all"></i>'.htmlspecialchars($username).' is Offline!</div></center>';
}
}
}
?>
当我以表单形式提交例如 google.com 时,它会回显结果以及错误
注意:使用未定义的常量成功 - 假定为“成功”
【问题讨论】:
-
你怎么看这个?
-
请注意,
center标记已过时。