Debug imagefile

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

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Debug imagefile

Post by Shendemiar »

Images to show in html needs to be linked, so, and php generated image must a separate file.

IF i get errors in this file, how am i able to see them? I only get a empty image placeholder.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

What? 8O

Please reword
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

I think I see what you're asking.

You're getting GD to generate you an image file. The image file will have a .php extension. And that you put the location of the .php script into the <img> tag. If so, you can't really see the errors, except for in a debugger (such as Zend studio). If you type in the URL of the php script into the adress bar, it'll give you one of two things: a parse error (in which case you know the line # and can fix it), or "this image cannot be displayed because it contains errors". In a case of the latter, the Zend debugger is the only way to go to make sure you're using the right variables, the right commands, etc.

Good luck!
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

evilmonkey wrote:If you type in the URL of the php script into the adress bar, it'll give you one of two things: a parse error (in which case you know the line # and can fix it), or "this image cannot be displayed because it contains errors". In a case of the latter, the Zend debugger is the only way to go to make sure you're using the right variables, the right commands, etc.

Good luck!
Thanks!
Post Reply