Nikkolus
10-03-2004, 07:22 AM
I found this script:
<?
/*
* This script is copyright PHPGarage.com (On Line Construction Inc.). It may be used,
* changed, and distributed freely as long as this message and/or some type of recognition
* is given to PHPGarage.com or On Line Construction Inc.
*
* http://www.phpgarage.com
* http://www.onlineconstructioninc.com
*
*/
$register_globals = (bool) ini_get('register_gobals');
if ($register_globals) $ip = getenv(REMOTE_ADDR);
$ip = $_SERVER['REMOTE_ADDR'];
$CurrentDate = date("m-d-Y h:ia");
$TextFile = "aimtracker.html";
$Body = "$_REQUEST[name] $ip<br>";
$Body .= file_get_contents($TextFile);
$Anon = "Unknown User";
{
if ( empty ($_REQUEST[name]) ) {
($FP = fopen ($TextFile, "w") )
fwrite($FP, $Anon);
fclose($FP);
}
{
else (($FP = fopen($TextFile, "w"))
fwrite($FP, $Body);
fclose($FP);
}
?>
But it gives me this error when I try to execute it:
Parse error: parse error, unexpected T_STRING in /home/public_html/folder/main2.php on line 24
Line 24 is fwrite($FP, $Anon);
Any ideas? I'm pretty new to php, sorry.
<?
/*
* This script is copyright PHPGarage.com (On Line Construction Inc.). It may be used,
* changed, and distributed freely as long as this message and/or some type of recognition
* is given to PHPGarage.com or On Line Construction Inc.
*
* http://www.phpgarage.com
* http://www.onlineconstructioninc.com
*
*/
$register_globals = (bool) ini_get('register_gobals');
if ($register_globals) $ip = getenv(REMOTE_ADDR);
$ip = $_SERVER['REMOTE_ADDR'];
$CurrentDate = date("m-d-Y h:ia");
$TextFile = "aimtracker.html";
$Body = "$_REQUEST[name] $ip<br>";
$Body .= file_get_contents($TextFile);
$Anon = "Unknown User";
{
if ( empty ($_REQUEST[name]) ) {
($FP = fopen ($TextFile, "w") )
fwrite($FP, $Anon);
fclose($FP);
}
{
else (($FP = fopen($TextFile, "w"))
fwrite($FP, $Body);
fclose($FP);
}
?>
But it gives me this error when I try to execute it:
Parse error: parse error, unexpected T_STRING in /home/public_html/folder/main2.php on line 24
Line 24 is fwrite($FP, $Anon);
Any ideas? I'm pretty new to php, sorry.