GD - Picture not being shown

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

How many more times do I have to ask you to remove your signature?
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

No offense, I just looked and it creates no cookies. Maybe it's something on your end. I will email you the file for you to see yourself.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Straterra I think you ought to stop jerking me around and do what I have asked.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

I'm not jerking you around! The file does NOT create a cookie. Ask other people if it creates a cookie on their end! I know for a fact that the forums create a cookie when you log in. I just cleared my cookies, viewed the image, and no cookie was made.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Shut up about the cookies. Edit your profile. Now please.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

FINE! I WILL EDIT IT FOR A PROBLEM THAT DOESN'T EXIST!
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

There, I edited it! I took out the non-working link.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Keep editing you missed a bit.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

What am I to edit out? I am totally confused what we are aguing about. Could you please enlightment me on what we are arguing about?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

It's perfectlyobvious from your previous comments that you do know exactly what I want you to do. Please don't waste any more of my time.

You have a simple choice if you really want to push things this far. You can comply with moderators requests or you can stop posting here.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Jesus..Fine! I deleted my picture which I spent alot of time on that does not set a cookie! I will post the code here so that you can see that it does not set a cookie.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

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); 
?>
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

My browser pops up an accept box when a site tries to set a cookie. I got one for your site (drewprofile.sytes.net) when I viewed the forum topic. It's logged in my cookie manager.

Why were you setting cookies?
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

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:

Post by Straterra »

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.
Post Reply