[請益] PHP內建變數
最近開始撰寫php程式,
以下的程式碼是希望run出來後可以顯示目前瀏覽者再看哪個php程式及其IP,
<?php
//Echo the script name
echo"You are running the file <b>$PHP_SELF</b>.<br/><br/>\n";
//Echo the user's information
echo'You are viewing this page
using:<br/><b>',$HTTP_USER_AGENT,'</b><br/>from the IP
address',$REMOTE_ADDR;
?>
但是執行時卻跑出以下畫面:
Notice: Undefined variable: PHP_SELF in c:\program
files\easyphp1-7\www\predefined.php on line 14
You are running the file .
You are viewing this page using:
Notice: Undefined variable: HTTP_USER_AGENT in c:\program
files\easyphp1-7\www\predefined.php on line 17
from the IP address
Notice: Undefined variable: REMOTE_ADDR in c:\program
files\easyphp1-7\www\predefined.php on line 17
不知道出了什麼問題,
register-globals設成開啟的狀態後還是無法解決,
麻煩各位解惑了,
謝謝^^
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 134.208.34.72
→
02/18 16:49, , 1F
02/18 16:49, 1F
→
02/18 16:49, , 2F
02/18 16:49, 2F
推
02/18 16:56, , 3F
02/18 16:56, 3F
推
02/18 18:14, , 4F
02/18 18:14, 4F