|
||||||||||
|
|||||||
| GoogleCommunity Sponsor |
Use coupon "forum" for 50% Off! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Master Googler
![]() Join Date: Mar 2006
Location: Terminus
Posts: 531
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Call to PHP in signature
I have a PHP script which detects the visitors' ip, and creates a [email]root@you.rip.adr.ess[/url] image using the gd library.I've seen that script used on other forums (in siggies), and I'd like to add it here too. br
|
|
|
|
|
Sponsored Links
|
|
|
|
#2 (permalink) |
|
Google Guru
![]() Join Date: Oct 2005
Location: c:\GoogleCommunity
Posts: 3,368
Thanks: 3
Thanked 12 Times in 12 Posts
![]() ![]() ![]() ![]() ![]() |
PNG image [I think other image types work too, but PNG springs to mind].
You have to generate the PNG using PHP then destroy the image when done. You need a folder on your webserver, and you need to put a .htaccess file in this folder with the following code: Code:
AddType application/x-httpd-php .png Then, this should be saved as sig.png: Code:
<?php
header("Content-type: imageNG");
$text2 = "Your IP is: '.$_SERVER['REMOTE_ADDR'].'.";
$image = imagecreatefrompng("sigback.png");
/* Hex text colour */
$colour = imagecolorallocate($image, 255, 255, 255);
/* X and Y coordinates for the text on your image */
$px=120;
$py=30;
imagestring($image, 2, $px, $py+12, $text2, $colour);
imagepng($image);
imagedestroy($image);
?>
|
|
|
|
|
|
#3 (permalink) |
|
Master Googler
![]() Join Date: Mar 2006
Location: Terminus
Posts: 531
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
You didn't understand me, I already have a script.
Code:
<?php
header("Content-type: image/png");
$im = imagecreatefrompng("rootsig.png");
$color = imagecolorallocate($im, 0, 0, 0);
$font = "fonts/verdana.ttf";
$rmpath = $_SERVER['REMOTE_ADDR'];
$curup = "root@".$rmpath;
imageAlphaBlending($im, true);
imageSaveAlpha($im, true);
imagettftext($im, 7.5, 0, 0, 12, $color, $font, $curup);
imagepng($im);
imagedestroy($im);
?>
But how can I insert this png HERE (GC), so every once a user visits the forum he would get this image with his own IP. |
|
|
|
|
|
#6 (permalink) |
|
Google Guru
![]() Join Date: Oct 2005
Location: c:\GoogleCommunity
Posts: 3,368
Thanks: 3
Thanked 12 Times in 12 Posts
![]() ![]() ![]() ![]() ![]() |
Um, I dunno.
Did you by any chance put rootsig.png in your signature instead of sig.png? Does your host support the GD Library? Hang on, and I'll try and set up mine, and see if I have any difficulties. EDIT: I have difficulties telling the PNG file to be a PHP file. I got my PHP file to work. [Here], but when I rename it sig.png, when I try to open the file, it asks what program I want to use to download it. I have a .htaccess file telling all files to open as PHP, regardless of extension, so I'm not sure if it's just my host. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Call Of Duty 2 | 357_magnum | Gaming | 23 | 11-05-2006 09:04 AM |
| pls call me by Gtalk! | zglzhl | Google Talk | 0 | 09-08-2005 05:11 AM |
| call me an idiot if u want | sirlaguna | Social Networking | 9 | 08-11-2005 05:29 AM |
| Old timers call | dude66 | Chit Chat | 12 | 07-17-2005 06:09 AM |