eXPerience-XP Posted September 25, 2003 Posted September 25, 2003 I noticed that some ppl have a sig where theres an image and it shows the viewers IP and Operating system. Could someone show me how to do this?
XPerties Posted September 25, 2003 Posted September 25, 2003 I'm thinking this is in the WRONG section.
Carmon Posted September 25, 2003 Posted September 25, 2003 XPerties Posted on Sep 25 2003, 09:17 PM I'm thinking this is in the WRONG section.lol i been there dun dat lol
eXPerience-XP Posted October 25, 2003 Author Posted October 25, 2003 thx tinker i just saw ur reply now.. lol
gamehead200 Posted October 25, 2003 Posted October 25, 2003 Well, first of all, you need about 3 files which contain the following:.htaccess<Files ipaddress.jpg>ForceType application/x-httpd-php</Files>ipaddress.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 = '/path/to/your/ttf/font';ImageTTFText ($image, 8, 0, 10, 17, $white, $font, "Your IP Address is... ".$REMOTE_ADDR);// output and destroyimagepng($image);imagedestroy($image);?>and your font file. I use Verdana...If you continue playing on, you can put in a background color, pics, random text, etc. Good luck!
XPerties Posted October 25, 2003 Posted October 25, 2003 http://www.xperties.net/yah and you get the sig like this on my frontpage.
Thanatos Posted October 27, 2003 Posted October 27, 2003 The thing I don't get about those, is how do you use a custom image? I'm not too hot with php, but I can't see anything in that code which imports an image and overlays stuff onto it
XPerties Posted October 27, 2003 Posted October 27, 2003 The thing I don't get about those, is how do you use a custom image? I'm not too hot with php, but I can't see anything in that code which imports an image and overlays stuff onto itThe php calls holders (images) which are png files. The actually image you see is actually the script but you place a htaccess file and within that you trick the server to think its a jpg instead of .php file.
gamehead200 Posted October 27, 2003 Posted October 27, 2003 The thing I don't get about those, is how do you use a custom image? I'm not too hot with php, but I can't see anything in that code which imports an image and overlays stuff onto itYou have to use different commands:ipaddress.jpg<?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 = imagecreatefrompng("name-of-pic.png");// 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 = '/path/to/your/ttf/fontImageTTFText ($image, 8, 0, 10, 17, $white, $font, "Your IP Address is... ".$REMOTE_ADDR);// output and destroyimagepng($image);imagedestroy($image);?>
tawxic Posted November 3, 2003 Posted November 3, 2003 When I do this, it just shows me a blank page (both versions of scripts) - I think my hoster might be incompatible, but I don't know with what.. it can use PHP just fine... any suggestions? Here is what I have:.htaccess :Options None<Limit GET POST>order deny,allowdeny from allallow from allrequire group authors administrators</Limit><Limit PUT DELETE>order deny,allowdeny from all</Limit>AuthType BasicAuthName www.phazm.netAuthUserFile xxxx/service.pwdAuthGroupFile xxxx/service.grp<Files siggy.jpg>ForceType application/x-httpd-php</Files>then in siggy.jpg I have:<?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 = imagecreatefrompng("bg.png");// 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 = 'Arial.ttf'ImageTTFText ($image, 8, 0, 10, 17, $white, $font, "Your IP Address is... ".$REMOTE_ADDR);// output and destroyimagepng($image);imagedestroy($image);?>then in bg.png I have a pure black BG,and I have Arial.ttf in the same dir as everything else...
Recommended Posts