| |
cruocitae The Psychohistorist


Joined: 05 Mar 2006 Location: Terminus 2402.75 GC$
Items
|
Posted: Mon Jul 10, 2006 10:44 pm Post subject: Call to PHP in signature |
|
|
|
I have a PHP script which detects the visitors' ip, and creates a root@you.rip.adr.ess 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.
_________________ "Circles have no end!"
-- Arkady Darrell |
|
| Back to top |
|
|
andrew247 Feel the Power


Joined: 18 Oct 2005 Location: c:\GoogleCommunity 88888.75 GC$
Items
|
Posted: Tue Jul 11, 2006 9:38 am Post subject: |
|
|
|
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 |
You need to put an image in this folder called sigback.png (called in php file).
Then, this should be saved as sig.png:
| Code: |
<?php
header("Content-type: image/PNG");
$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);
?> |
This is untested, so I don't know if it'll work. _________________ Football Rumours | Gloog |
|
| Back to top |
|
|
cruocitae The Psychohistorist


Joined: 05 Mar 2006 Location: Terminus 2402.75 GC$
Items
|
Posted: Tue Jul 11, 2006 12:53 pm Post subject: |
|
|
|
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);
?>
|
Well, I admit that yours is a bit more simple.
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. _________________ "Circles have no end!"
-- Arkady Darrell |
|
| Back to top |
|
|
andrew247 Feel the Power


Joined: 18 Oct 2005 Location: c:\GoogleCommunity 88888.75 GC$
Items
|
Posted: Tue Jul 11, 2006 12:58 pm Post subject: |
|
|
|
Insert the PNG in your signature.
| Code: | | [img]http://www.yoursite.com/images/sig.png[/img] |
I don't understand your question now.  _________________ Football Rumours | Gloog |
|
| Back to top |
|
|
cruocitae The Psychohistorist


Joined: 05 Mar 2006 Location: Terminus 2402.75 GC$
Items
|
Posted: Fri Jul 14, 2006 3:22 am Post subject: |
|
|
|
If I isnert the png, there will only show up a blank white png, and it won't show the user it's ip. Not my ip. _________________ "Circles have no end!"
-- Arkady Darrell |
|
| Back to top |
|
|
andrew247 Feel the Power


Joined: 18 Oct 2005 Location: c:\GoogleCommunity 88888.75 GC$
Items
|
Posted: Fri Jul 14, 2006 4:10 am Post subject: |
|
|
|
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.  _________________ Football Rumours | Gloog |
|
| Back to top |
|
|
Sponsored Links
|
Posted: 5 Dec 2008 6:47 am Post subject: Advertisements |
|
|
|
|
|
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Host your free forums with Invision Plus.net forum web hosting with your own subdomain.
alexisBlue v1.2 // Theme Created By: Andrew Charron // Icons in Part By: Travis Carden
|
|
|
|
|