GD - Picture not being shown
Moderator: General Moderators
-
Straterra
- Forum Regular
- Posts: 527
- Joined: Mon Nov 24, 2003 8:46 am
- Location: Indianapolis, Indiana
- Contact:
Here is the code for the picture. Just copy and pasted from the file. It does NOT set any cookies...Besides, alot of websites set cookies. What would it matter if my GD picture set one?
Code: Select all
<?php
$val = file("imagecounter.txt");
$num = $val[0];
$num++;
$fp = fopen( "imagecounter.txt", "w" );
fwrite( $fp, $num );
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
header ("Content-type: image/png");
$img_handle = ImageCreate (400, 110) or die ("Cannot Create image");
$back_color = ImageColorAllocate ($img_handle, 0, 10, 10);
$txt_color = ImageColorAllocate ($img_handle, 255, 255, 255);
ImageTTFText ($img_handle, 9, 0, 5, 20, $txt_color, "/WINDOWS/Fonts/IMPACT.ttf",
"IP : ".$_SERVER['REMOTE_ADDR']);
ImageTTFText ($img_handle, 9, 0, 5, 40, $txt_color, "/WINDOWS/Fonts/IMPACT.ttf",
"HostName : ".$hostname);
ImageTTFText ($img_handle, 9, 0, 5, 60, $txt_color, "/WINDOWS/Fonts/IMPACT.ttf",
"Referer : ".$_SERVER['HTTP_REFERER']);
ImageTTFText ($img_handle, 9, 0, 5, 80, $txt_color, "/WINDOWS/Fonts/IMPACT.ttf",
"User Agent : ".$_SERVER['HTTP_USER_AGENT']);
ImageTTFText ($img_handle, 9, 0, 5, 100, $txt_color, "/WINDOWS/Fonts/IMPACT.ttf",
"You are viewer number $num");
ImagePng ($img_handle);
?>-
Straterra
- Forum Regular
- Posts: 527
- Joined: Mon Nov 24, 2003 8:46 am
- Location: Indianapolis, Indiana
- Contact:
I told you, drewprofile.sytes.net is NOT my site! I host it for someone else, and draw.php is the only file that is mine! He prolly uses the cookie so that when he detects the resolution of the browser, he saves the resolution settings to a cookie so that the site can always display the proper resolution.
-
Straterra
- Forum Regular
- Posts: 527
- Joined: Mon Nov 24, 2003 8:46 am
- Location: Indianapolis, Indiana
- Contact:
I do NOT see the reason why I cannot show my picture since the picture doesn't set or read any cookies. Maybe its the webserver, I don't know. I use a beta verson of PHP, the most recently released one...But if it is truly setting a cookie, which it isn't on my end, we need to find out why because it shouldn't set a cookie.