chadrt Posted July 14, 2007 Share Posted July 14, 2007 I am having issues with placing the following code within a full php script. The output becomes unreadable. However when I use it in a standalone script I experience no problems at all. <?php header ("Content-type: image/png"); $handle = ImageCreate (400, 25); $bg_color = ImageColorAllocate ($handle, 255, 255, 255); $txt_color = ImageColorAllocate ($handle, 0, 0, 0); ImageString ($handle, 5, 2, 4, "joe.blow.someone@somefriggenemailaddy.com", $txt_color); ImagePng ($handle); ?> No matter what I do I cant seem to integrate it my script, whose output can be seen here: www.callsignmail.com you can use KI4MVE in the first search criteria box. When I through that into the script it's output is not human readable it is converted into a bunch of very unreadable characters across the screen. What I eventually hope to accomplish is to use it to show an email address stored in my database on the screen in an image format rather than text that can be seen by unscrupulous site searching robots and email harvesters. Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
Caesar Posted July 14, 2007 Share Posted July 14, 2007 Are you just including the image/png file in your other page, or are you actually calling it using image tags in the html...looking at your html...I don't see the image tag anywhere. Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 14, 2007 Share Posted July 14, 2007 ... use it like this: <img src="my_gd_image_scriptname.php"> where my_gd_image_scriptname.php is the real name of the script to create the image. Quote Link to comment Share on other sites More sharing options...
chadrt Posted July 15, 2007 Author Share Posted July 15, 2007 ... use it like this: <img src="my_gd_image_scriptname.php"> where my_gd_image_scriptname.php is the real name of the script to create the image. The code snippet actually creates the image display for: ImagePng ($handle); If I were to use it in say a standalone script I would have to pass varriables to it before calling it. I just tried that and it works, but is there a way to put all that in the same script maybe by replacing the ImagePng ($handle) with something else so it acatually displays the image. I dont know I am a rookie at PHP. Quote Link to comment Share on other sites More sharing options...
chadrt Posted July 20, 2007 Author Share Posted July 20, 2007 Still looking for a way to use GD within my existing script. The point here is to hide any text based entry of an email address in my scripts output wether that be in the browser or View Source. I know that there are bots that search the internet every second of every day scanning pages and their server output. While a varriable is hidden till it is echo'd a varriable placed into an < img > tag would not be as it would be placed in the server output. I would like to take my email address and have it displayed as an image within an existing script. I thank you so much to the person who pointed out to me the img tag was needed but unfortunately now that I know that is how you have to do that I need to find a way to do it differently. I just dont want those robots to use my site as a place of harvesting. I appreciate any help that could be sent my way, Thank YOU!! Quote Link to comment Share on other sites More sharing options...
Caesar Posted July 20, 2007 Share Posted July 20, 2007 You would need to show the code you're using in the php file where you're calling the image from. That's likely where you're error is. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.