gamehead200 Posted June 5, 2005 Author Posted June 5, 2005 OK, I want you to try two more things...First, put this in:// get IP$ip = $_SERVER['REMOTE_ADDR'];$text = "Your IP address is $ip!";// replace this partImageTTFText ($image, 8, 0, 10, 17, $white, $font, $text);If that doesn't work, change your font to just the font name. Example:$font = 'verdana.ttf';If that doesn't work, well, I really don't know what will...
Cyberpawz Posted June 5, 2005 Posted June 5, 2005 OK, I want you to try two more things...First, put this in:// get IP$ip = $_SERVER['REMOTE_ADDR'];$text = "Your IP address is $ip!";// replace this partImageTTFText ($image, 8, 0, 10, 17, $white, $font, $text);If that doesn't work, change your font to just the font name. Example:$font = 'verdana.ttf';If that doesn't work, well, I really don't know what will... <{POST_SNAPBACK}>Should it look like this?<?phpHeader('Content-type: image/jpeg');Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');Header('Pragma: no-cache');// set the dimensions$img_width = 240;$img_height = 25;// create the image$image = imagecreate($img_width, $img_height);// set the background colour// number or is top left pixel x, top left pixel y, bottom right pixel x, bottom right pixel yimagefilledrectangle($image, 0, 0, $img_width, $img_height, $cool);// set the font and print text$font = TAGSXTREME.TTF;// get IP$ip = $_SERVER['REMOTE_ADDR'];$text = "Your IP address is $ip!";// replace this partImageTTFText ($image, 8, 0, 10, 17, $white, $font, $text);// the above will display your IP address// set the colours$cool = imagecolorallocate($image, 81, 86, 96);$black = imagecolorallocate($image, 0, 0, 0);$white = imagecolorallocate($image, 255, 255, 255);$red = imagecolorallocate($image, 255, 0, 0);$grey = imagecolorallocate($image, 204, 204, 204);$green = imagecolorallocate($image, 206, 129, 18);$blue = imagecolorallocate($image, 0, 0, 255);// output and destroyimagepng($image);imagedestroy($image);?>
gamehead200 Posted June 5, 2005 Author Posted June 5, 2005 Should it look like this?<?phpHeader('Content-type: image/jpeg');Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');Header('Pragma: no-cache');// set the dimensions$img_width = 240;$img_height = 25;// create the image$image = imagecreate($img_width, $img_height);// set the background colour// number or is top left pixel x, top left pixel y, bottom right pixel x, bottom right pixel yimagefilledrectangle($image, 0, 0, $img_width, $img_height, $cool);// set the font and print text$font = TAGSXTREME.TTF;// get IP$ip = $_SERVER['REMOTE_ADDR'];$text = "Your IP address is $ip!";// replace this partImageTTFText ($image, 8, 0, 10, 17, $white, $font, $text);// the above will display your IP address// set the colours$cool = imagecolorallocate($image, 81, 86, 96);$black = imagecolorallocate($image, 0, 0, 0);$white = imagecolorallocate($image, 255, 255, 255);$red = imagecolorallocate($image, 255, 0, 0);$grey = imagecolorallocate($image, 204, 204, 204);$green = imagecolorallocate($image, 206, 129, 18);$blue = imagecolorallocate($image, 0, 0, 255);// output and destroyimagepng($image);imagedestroy($image);?><{POST_SNAPBACK}>Just move the following up to before it says "set background colour":// set the colours$cool = imagecolorallocate($image, 81, 86, 96);$black = imagecolorallocate($image, 0, 0, 0);$white = imagecolorallocate($image, 255, 255, 255);$red = imagecolorallocate($image, 255, 0, 0);$grey = imagecolorallocate($image, 204, 204, 204);$green = imagecolorallocate($image, 206, 129, 18);$blue = imagecolorallocate($image, 0, 0, 255);
Cyberpawz Posted June 5, 2005 Posted June 5, 2005 Still no go... can you try the code itself, so to see if it actually works? I'm getting frustrated here, and there should be no reason why this isn't working...
gamehead200 Posted June 5, 2005 Author Posted June 5, 2005 Still no go... can you try the code itself, so to see if it actually works? I'm getting frustrated here, and there should be no reason why this isn't working...<{POST_SNAPBACK}>The code is working fine on my machine... I will even start my Mac's webserver to see if its a Mac problem... BRB...
XPerties Posted June 5, 2005 Posted June 5, 2005 If I might add, the server you are on has register_globals=off which might be causing an issue. It did for a few clients of mine. Here is a walk around to make sure it isn't....===================[1] Within your account in public_html folder or the directory where the script is no longer working you may find a .htaccess. If not you may need to create a .htaccess file.[2] Open this file up or create it and add:php_value register_globals 1===================
Cyberpawz Posted June 5, 2005 Posted June 5, 2005 If I might add, the server you are on has register_globals=off which might be causing an issue. It did for a few clients of mine. Here is a walk around to make sure it isn't....===================[1] Within your account in public_html folder or the directory where the script is no longer working you may find a .htaccess. If not you may need to create a .htaccess file.[2] Open this file up or create it and add:php_value register_globals 1===================<{POST_SNAPBACK}>No go. I just tried this on another site, to post the .jpg as just that, and it's not being parsed right at all...
tj007s13 Posted June 5, 2005 Posted June 5, 2005 now...u said screen resolution could only be done by incorporating javascript in right? How would i go about doing that?
gamehead200 Posted June 5, 2005 Author Posted June 5, 2005 You can't really put someone's resolution in a signature without having them go to another site to store it in a cookie.
megafan Posted June 22, 2005 Posted June 22, 2005 Hey how do u install the GD plugin? After uploading u'r sample thsi is what I am getting http://govinda.us/sig/mysig.jpgSo i am guessing its because of the GD plugin. Can u help me. THanks
SoKoOLz Posted August 17, 2005 Posted August 17, 2005 I have verys trange problem, when I have created my sig. It works perfectly on my test server(with Appserv installed). But when I put it on my host, it the forced me to download the image instead of showing the image. With an error inside saying that "<b>Fatal error</b>: Call to undefined function: imagettftext() in <b>/usr/local/xxx/home/vhosts/xxx.com/httpdocs/sig/test.jpg</b> on line <b>133</b><br />"
theodonnells Posted August 31, 2005 Posted August 31, 2005 I tried this tutorial but cant get it to work....When i used the zip files all i got was a red x where pic should be,so tried with my own graphic but no joy.....My sigHeres my code,<?phpHeader ('Content-type: image/jpeg');Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');Header('Pragma: no-cache');// create the image using your own background$image = imagecreatefromjpeg("background.jpg");// dimensions of the image used$img_width = 380;$img_height = 50;// set the colours$cool = imagecolorallocate($image, 81, 86, 96);$black = imagecolorallocate($image, 0, 0, 0);$white = imagecolorallocate($image, 255, 255, 255);$red = imagecolorallocate($image, 255, 0, 0);$grey = imagecolorallocate($image, 204, 204, 204);$green = imagecolorallocate($image, 206, 129, 18);$blue = imagecolorallocate($image, 0, 0, 255);// set the font and print text$font = 'verdana.ttf';// now i will create a line with font size 8, with no angle, 10 pixels to the right, and 17 pixels downImageTTFText ($image, 8, 0, 10, 17, $white, $font, "Your IP Address is... ".$REMOTE_ADDR);// the above will display your IP address// output and destroyimagepng($image);imagedestroy($image);?>Do you just upload the fonts from your windows fonts folder?
SuperBleeder Posted August 31, 2005 Posted August 31, 2005 I tried this tutorial but cant get it to work....When i used the zip files all i got was a red x where pic should be,so tried with my own graphic but no joy.....My sigHeres my code,[code here]Do you just upload the fonts from your windows fonts folder?<{POST_SNAPBACK}>The erroryou are getting now I used to get until I setup .htaccess correctly Pretty simple to do when you have it setup right (I killed my host setting up GD2 not knowing I already had it installed )http://www.psychoman.co.nr/test/mysig.png
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now