php Display users ip in signature [Snipplet]

5 posts Page 1 of 1
Contributors
User avatar
benji_19994
VIP - Donator
VIP - Donator
Posts: 156
Joined: Mon Apr 16, 2012 3:13 pm

Finished project will look like:
Image
Code: Select all
<?php
header("Content-type: image/jpeg");

$ip ='Your IP Adress is: '.$_SERVER['REMOTE_ADDR'].'';

$ip_lengh = strlen($ip);

$font_size = 7;

$image_height = ImageFontHeight($font_size);

$image_width = ImageFontWidth($font_size) * $ip_lengh;

$image = imagecreate($image_width, $image_height);

imagecolorallocate($image, 255, 255, 255);

$font_color = imagecolorallocate($image, 0, 0, 0);

imagestring($image, $font_size, 0, 0, $ip, $font_color);

imagejpeg($image);

?>


Now just add the link in your signature like you would normally :)

Need help ask and i'll see what i can do.
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Not accusing you of anything, but if you want a full tutorial you might as well look at my original post: http://codexvideos.com/php-image-with-v ... p-address/

The interesting thing is that this is the first time I see a similar 'topic' (even though it's a snippet) of the one I posted.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
benji_19994
VIP - Donator
VIP - Donator
Posts: 156
Joined: Mon Apr 16, 2012 3:13 pm

This is not what you have posted... Actually i watched the video on php academy that showed you how to use the gd library to write an email into an image so crawers cannot get your email address.
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

benji_19994 wrote:
This is not what you have posted... Actually i watched the video on php academy that showed you how to use the gd library to write an email into an image so crawers cannot get your email address.
As I said, I wasn't accusing you. Anyways, crawlers can simply use OCR on images to get the email or the text written on the image.

(Optical character recognition)
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
benji_19994
VIP - Donator
VIP - Donator
Posts: 156
Joined: Mon Apr 16, 2012 3:13 pm

Ah sorry for that haha i just didn't want people to think that i am a leecher
5 posts Page 1 of 1
Return to “Tutorials”