我一直在尝试创建一个表单,以 HTML 的形式创建票证以轻松组织事物并查看问题,但是每次我尝试对此进行测试时,它只显示变量,因为$variable
这里是我正在使用的脚本为了尝试使这项工作:
function ip(){if (!empty($_SERVER['HTTP_CLIENT_IP'])){$ip=$_SERVER['HTTP_CLIENT_IP'];}else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];}else{$ip=$_SERVER['REMOTE_ADDR'];}return $ip;}
$ip = ip();
$date = date("Y-m-d h:i:s A");
$emailField = $_GET['Email'];
$issue = $_GET['issue'];
$ticketField = $_GET['Ticket'];
$ip = $ip;
$date = $date;
$file = 'admin/logs.php';
$lines = file($file);
$all_lines = implode('',$lines);
$entry = str_replace('<script type="text/javascript" language="JavaScript">endtable()</script><script type="text/javascript" language="JavaScript">copyright()</script>',' <tr>
<td><div id="logleft"></div></td>
<td><div id="logmid"><center>$emailField</center></div></td>
<td><div id="logmid"><center>$ip</center></div></td>
<td><div id="logmid"><center>$issueField</center></div></td>
<td><div id="logmid"><center>$ticketField</center></div></td>
<td><div id="logright"></div></td>
</tr>
<script type="text/javascript" language="JavaScript">endtable()</script><script type="text/javascript" language="JavaScript">copyright()</script>',$all_lines);
$fp = fopen($file,'w');
$fw = fwrite($fp,$entry);
fclose($fp);
我已确保表单操作是 GET 而不是 POST,但是没有任何效果,它仍然将变量显示为$variable