我一直在試圖創建一個表單來創建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,而不是帖子,但沒有什麼工作,它仍然顯示變量$variable
確保'admin'目錄有寫入權限運行Web服務器進程 – Orangepill