Google Community Chat
 
Call to PHP in signature

You're visiting Google Community as a guest.
In order to post, you'll need to register and log in.



(If you were registered and logged in, these advertisements wouldn't be here)
Post new topic   Reply to topic    Google Community Forum Index // GC Announcements, Feedback & Questions
   
Author Message
cruocitae
The Psychohistorist
Master Googler


Joined: 05 Mar 2006
Location: Terminus
2402.75 GC$

Items

PostPosted: Mon Jul 10, 2006 10:44 pm    Post subject: Call to PHP in signature Reply with quote
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
View user's profile Send private message Visit poster's website Google Talk
andrew247
Feel the Power
Google Guru


Joined: 18 Oct 2005
Location: c:\GoogleCommunity
88888.75 GC$

Items

PostPosted: Tue Jul 11, 2006 9:38 am    Post subject: Reply with quote
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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Google Talk
cruocitae
The Psychohistorist
Master Googler


Joined: 05 Mar 2006
Location: Terminus
2402.75 GC$

Items

PostPosted: Tue Jul 11, 2006 12:53 pm    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website Google Talk
andrew247
Feel the Power
Google Guru


Joined: 18 Oct 2005
Location: c:\GoogleCommunity
88888.75 GC$

Items

PostPosted: Tue Jul 11, 2006 12:58 pm    Post subject: Reply with quote
Insert the PNG in your signature. Confused
Code:
[img]http://www.yoursite.com/images/sig.png[/img]

I don't understand your question now. Smile
_________________
Football Rumours | Gloog
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Google Talk
cruocitae
The Psychohistorist
Master Googler


Joined: 05 Mar 2006
Location: Terminus
2402.75 GC$

Items

PostPosted: Fri Jul 14, 2006 3:22 am    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website Google Talk
andrew247
Feel the Power
Google Guru


Joined: 18 Oct 2005
Location: c:\GoogleCommunity
88888.75 GC$

Items

PostPosted: Fri Jul 14, 2006 4:10 am    Post subject: Reply with quote
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. Sad

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. Confused
_________________
Football Rumours | Gloog
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Google Talk
Sponsored Links
Posted: 21 Aug 2008 8:01 pm    Post subject: Advertisements
Back to top
Post new topic   Reply to topic    Google Community Forum Index // GC Announcements, Feedback & Questions All times are GMT - 8 Hours
Page 1 of 1


 
Jump to:  
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

© 2005-2006 Google Community

Powered by phpBB

Privacy Policy | Contact Us

Powered by Google Search blog

This website is not affiliated in any way with Google, Inc.
Google™ is a registered trademark of Google, Inc.