PHP string and variables?

moofin_poofin

New member
I have a PHP file that get IP addresses and stores them in ips.txt
the line with asterisks (*) around it is giving me trouble:

<?php
$fn = "ips.txt";
*** $content = "$_SERVER['REMOTE_ADDR'] accessed your site at $date('m'/'d'/y')"; ***
$fp = fopen($fn,"a") or die ("Error opening file in write mode.");
if ($_SERVER['REMOTE_ADDR'] == '76.98.42.222') {
echo "<script lang='javascript'>";
echo "alert('Hello, Daniel')";
echo "</script>";
}
else {
fputs($fp,$content);
fclose($fp) or die ("Error closing file.");
}
?>

How can I have the $content variable set to "$_SERVER['REMOTE_ADDR'] accessed your site at
$date('m'/'d'/y')"?


P.S. I don't care if the date variable is wrong, that's not the problem
 
Back
Top