Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP Image: How To Show A User Their IP In Your Signature.
#1
First of all, I found this on http://www.thesitewizard.com/ so credits go to them for that but I'm writing this out myself.

Requirements:
  • A Domain
  • Hosting For It
  • Patience
  • Spare 20 Minutes On Your Hands

Okay first of go to your public_html in your cPanel, make a new directory called "img".

Make a file called "index.php" (this then becomes the default page for the img directory)

Inside the index.php, enter this following code:

PHP Code:
<?php
$ip 
$_SERVER['REMOTE_ADDR'];
$my_img imagecreate25080 );
$background imagecolorallocate$my_img102102102 );
$text_colour imagecolorallocate$my_img255255);
$line_colour imagecolorallocate$my_img128255);
imagestring$my_img43025"Your IP Is: $ip",
  
$text_colour );
imagesetthickness $my_img);
imageline$my_img304522045$line_colour );

header"Content-type: image/png" );
imagepng$my_img );
imagecolordeallocate$line_color );
imagecolordeallocate$text_color );
imagecolordeallocate$background );
imagedestroy$my_img );
?>

Make Sure You Save It!

Okay, that should be done, now go to http://www.YourDomain.com/img and you should see your IP.

Go onto the forum of which you want this is your signature, go to the UserCP and click "Edit Signature".

In your signature enter this following BBCode:

Code:
[img]http://www.YourDomainHere.com/img/index.php[/img]

If you want to get the exact colours for the backgrounds of forums. so it looks just like the text then edit this:

PHP Code:
$background imagecolorallocate$my_img102102102 ); 

Change it to:

HackForums
PHP Code:
$background imagecolorallocate$my_img102102102 ); 

SupportForums
PHP Code:
$background imagecolorallocate$my_img878787 ); 
(Want any other forum codes just request them (post forum you want the code for) )



You're Done! Congratulations!

Now Go Freak Out Some People Big Grin
Reply


Messages In This Thread
PHP Image: How To Show A User Their IP In Your Signature. - by BreShiE - 09-08-2011, 01:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 807 07-27-2020, 11:26 PM
Last Post: tk-hassan
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,333 10-10-2011, 01:00 PM
Last Post: Greyersting
  PHP Signature Rotator with Links Dutchcoffee 9 3,502 12-12-2010, 05:20 PM
Last Post: NathanE
  Random Image PHP Matt G 13 3,257 11-24-2010, 01:21 PM
Last Post: Sam
  User Management Script - User Cake Support 9 5,340 05-13-2010, 03:21 PM
Last Post: Julie

Forum Jump:


Users browsing this thread: 2 Guest(s)