gamehead200 Posted November 3, 2003 Posted November 3, 2003 Create a PHP file and put this in it:<?php phpinfo(); ?>Scroll down to see if GD is enabled, if it isn't, then that is probably your main problem! And you shouldn't put anything else in the .htaccess file except for what I mentioned above!
tawxic Posted November 4, 2003 Posted November 4, 2003 http://www.phazm.net/phpinfo.phpGD is enabled :-/and .htaccess is fine, I renamed the file to a .php (http://www.phazm.net/siggy.php) and it's just the red x :-/
tawxic Posted November 4, 2003 Posted November 4, 2003 I just hate .htaccess only ave what you said to (with my own filename):<Files siggy.jpg>ForceType application/x-httpd-php</Files>and I made siggy.jpg:<?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 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 background colour and borderimagefilledrectangle($image, 0, 0, $img_width, $img_height, $cool);// set the font and print text$font = 'Arial.ttf';ImageTTFText ($image, 8, 0, 10, 17, $white, $font, "Your IP Address is... ".$REMOTE_ADDR);// output and destroyimagepng($image);imagedestroy($image);?>and it just comes up with a blank page:http://www.phazm.net/siggy.jpggah! :-P
tawxic Posted November 4, 2003 Posted November 4, 2003 well, I got http://www.phazm.net/siggy.php to draw a bg color... (I just went in and changed some php.ini settings) but it doesn't write any text.
gamehead200 Posted November 4, 2003 Posted November 4, 2003 Try putting the full path to your font without using CAPITAL letters... Then it might work...
crowman Posted November 5, 2003 Posted November 5, 2003 wow this sounds and looks very hard and confusing, I had a look at a site which was a tutorial for PHP and my god i think i will skip it
tawxic Posted November 5, 2003 Posted November 5, 2003 woot!okay, adding the full path worked... I now have it working, but only under a .php file.. when I rename it to .jpg or .png and add the neccisary .htaccess file, it's just a blank page, with the php source in the source of the document.. without the .htaccess file telling it to act as if it were php, it displays the php source in the window, so it seems as if the file just isn't loading as if it was php.... suggestions?(this board doesn't allow the .php extension for img tags :-/
tawxic Posted November 5, 2003 Posted November 5, 2003 hey, a bit off topic maybe, but related... I want to add the CLIENT time in my sig, but I can't think of a way to get the client time in PHP, and I don't think I can use javascript in the image, can I? if no, what are my possible solutions, if any?
gamehead200 Posted November 5, 2003 Posted November 5, 2003 woot!okay, adding the full path worked... I now have it working, but only under a .php file.. when I rename it to .jpg or .png and add the neccisary .htaccess file, it's just a blank page, with the php source in the source of the document.. without the .htaccess file telling it to act as if it were php, it displays the php source in the window, so it seems as if the file just isn't loading as if it was php.... suggestions?(this board doesn't allow the .php extension for img tags :-/Glad it worked out...Please post your codes here so I can take a look at them...Is it the client time you want or the server time? I know its written CLIENT, just want to make sure!
gamehead200 Posted November 5, 2003 Posted November 5, 2003 <Files siggy.jpg>ForceType application/x-httpd-php</Files>...and it just comes up with a blank page:http://www.phazm.net/siggy.jpggah! :-PIf both siggy.jpg and siggy.php are in the same folder using the same .htaccess file, you must change the .htaccess file and input the following:<Files siggy.jpg>ForceType application/x-httpd-php</Files><Files siggy.php>ForceType application/x-httpd-php</Files>This way, it will parse both files!
tawxic Posted November 5, 2003 Posted November 5, 2003 siggy.php ::<?Header ('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');$COUNT_FILE = "hitcounter.dat";if (file_exists($COUNT_FILE)) { $fp = fopen("$COUNT_FILE", "r+"); flock($fp, 1); $count = fgets($fp, 4096); $count += 1; fseek($fp,0); fputs($fp, $count); flock($fp, 3); fclose($fp);} else { echo "Can't find file, check '\$file'<BR>";}// set the dimensions$img_width = 240;$img_height = 25;// create the image$image = imagecreate($img_width, $img_height);// 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 background colour and borderimagefilledrectangle($image, 0, 0, $img_width, $img_height, $blue);// set the font and print text$font = '/var/www/html/verdana.ttf';// ImageTTFText ($image, 8, 0, 10, 17, $black, $font, "Your IP Address is... ".$visitors);ImageTTFText ($image, 8, 0, 10, 17, $black, $font, "Views: ".$count);// output and destroyimagepng($image);imagedestroy($image);?>ENDThis will just put a blue bar with a nice counter on there (if you have the hitcounter.dat file in the same dir)example: http://www.phazm.net/signature/siggy.php
tawxic Posted November 5, 2003 Posted November 5, 2003 I added what tou said to htaccess... still isn't parsinghttp://www.phazm.net/signature/siggy.jpg
tawxic Posted November 5, 2003 Posted November 5, 2003 Can you do me a fav?d/l http://www.phazm.net/siggy.rar and u/l it to your own webspace? (just the 3 files) so I can see if it's a compatibility issue with my hoster?
Carmon Posted November 5, 2003 Posted November 5, 2003 crowman Posted on Nov 5 2003, 01:40 AM wow this sounds and looks very hard and confusing, I had a look at a site which was a tutorial for PHP and my god i think i will skip itam wiv u crowman lol
gamehead200 Posted November 5, 2003 Posted November 5, 2003 siggy.php ::...ENDThis will just put a blue bar with a nice counter on there (if you have the hitcounter.dat file in the same dir)example: http://www.phazm.net/signature/siggy.phpMine's simpler:<?phpHeader ('Content-type: image/png');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$image = imagecreatefromgif("about-bg.gif");// set the colours$cool = imagecolorallocate($image, 87, 87, 87);$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);// counter$viewss = file("views.txt");$views = $viewss[0]; $views++;$fp = fopen("views.txt", "w");fwrite($fp, $views);fclose($fp);$counter = "GAMEHEAD200 || This sig has been viewed $views times!";// define geek code$geek = "-----BEGIN GEEK CODE BLOCK-----Version: 3.1GCS d+ s+:+ a---- C++ !U !P L+ E-- W+++$ N+ !o K- w++$O--- M$ V? PS PE++ Y+ !PGP !t !5 !X !R tv+++ b++ DI !DG e- h! r-- !y------END GEEK CODE BLOCK------";// line style line$line = "________________________________________________________";// set the font and print text$font = 'font.ttf'; ImageTTFText ($image, 8, 0, 12, 45, $black, $font, $geek); ImageTTFText ($image, 8, 0, 12, 148, $black, $font, $line); ImageTTFText ($image, 8, 0, 12, 180, $black, $font, $counter);// output and destroyimagepng($image);imagedestroy($image);?>Try to find out how it works! I'll try using yours tonight because right now I don't have the time...
Recommended Posts