Just create a directory, put this php code into a file which is saved as a .jpg file. You need a real image, in my case called sig.jpg in the same directory, and a file called (in my case) siginfo22.txt - this must be chmod’d to 777. Obviously, file names etc can be different, but must also be changed in code below. Oh, and create a .htaccess, as shown at top of that code.
Here is the script:
create a .htaccess file containing the following two lines:
Options All -Indexes
ForceType application/x-httpd-php
the first one means if someone tries to view directory, they are not
shown it, the second allows the script to work
*/
header(”Content-type: image/jpeg”);
$ip = getenv(”REMOTE_ADDR”);
$date = date(”d”) . ” ” . date(”F”) .
” ” . date(”Y”);
$ref = getenv(’HTTP_REFERER’);
$ua = $_SERVER['HTTP_USER_AGENT'];
$intofile = $ip . ” || ” . $date . ” || ” . $ref
. ” || ” . $ua . “
”;
$hfile = fopen(”siginfo22.txt”, “a”);
fwrite($hfile, $intofile);
fclose($hfile);
$BGImage = imagecreatefromjpeg(”sig.jpg”);
imagejpeg($BGImage);
imagedestroy($BGImage);
?>
0 comments:
Post a Comment