<?php
$person = $_COOKIE['login'];
$current = file_get_contents("../" . $person . "_extras.txt");
$content = "<img src=\"" . $_GET['file'] . "\" /><br />";
if ($current != $content) {
$file = "../" . $person . "_extras.txt";
$file1h = fopen($file, 'w') or die("can't open file");
fwrite($file1h, $content);
fclose($file1h);
echo "You now have a custom avatar!";
}
else {
echo "You already have this avatar!";
}
?>