Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 04:41:22 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 51
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 44
Total: 44

Author Topic: Ip adress block !  (Read 16803 times)

0 Members and 1 Guest are viewing this topic.

evilopinions

  • Guest
Ip adress block !
« on: January 03, 2006, 11:13:35 PM »
I feel this is silly but may look hi-tech to newbies on your forum !

Show them their ip adress.

Box heading : Your IP adress.(logged)

Code: [Select]
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
 
echo $hostname;

Offline Ray

  • Sr. Member
  • ****
  • Posts: 446
Re: Ip adress block !
« Reply #1 on: January 03, 2006, 11:54:54 PM »
Cool I love toys -- works good-- thank you ;D

gerrymo

  • Guest
Re: Ip adress block !
« Reply #2 on: January 04, 2006, 05:37:46 AM »
Wouldnt work for me in a side block (Much too wide). What I did was make a file "image.php" with the code below in it.
Code: [Select]
<?php
$img_number 
imagecreate(150,25);
$backcolor imagecolorallocate($img_number,102,102,153);
$textcolor imagecolorallocate($img_number,255,255,255);
imagefill($img_number,0,0,$backcolor);
$number "$_SERVER[REMOTE_ADDR]";
Imagestring($img_number,10,5,5,$number,$textcolor);

header("Content-type: image/jpeg");
imagejpeg($img_number);
?>


And upload to my server. Then put the code below into a java/html block:
Code: [Select]
<img src="http://yoursite/image.php" border="1">

And, hey presto, the user's IP Addy.

houston

  • Guest
Re: Ip adress block !
« Reply #3 on: January 04, 2006, 08:56:23 PM »
Thanks for the code.  O0

Cool Surfer

  • Guest
Re: Ip adress block !
« Reply #4 on: August 12, 2006, 06:26:08 AM »
Thanks cool codes. :)

shadrach

  • Guest
Re: Ip adress block !
« Reply #5 on: August 13, 2006, 11:24:45 AM »
rofl, too bad its isp and not IP data

Azraeliitti

  • Guest
Re: Ip adress block !
« Reply #6 on: August 15, 2006, 01:43:40 PM »
Here's the PHP code for showing the actual IP-address:

Code: [Select]
echo $_SERVER["REMOTE_ADDR"];

gerrymo

  • Guest
Re: Ip adress block !
« Reply #7 on: August 15, 2006, 03:58:11 PM »
The one I posted in http://www.tinyportal.net/smf/index.php?topic=1910.msg15394#msg15394 can actuall be used in any site page.

Gargoyle

  • Guest
Re: Ip adress block !
« Reply #8 on: August 15, 2006, 09:11:27 PM »
Wouldnt work for me in a side block (Much too wide). What I did was make a file "image.php" with the code below in it.
Code: [Select]
<?php
$img_number 
imagecreate(150,25);
$backcolor imagecolorallocate($img_number,102,102,153);
$textcolor imagecolorallocate($img_number,255,255,255);
imagefill($img_number,0,0,$backcolor);
$number "$_SERVER[REMOTE_ADDR]";
Imagestring($img_number,10,5,5,$number,$textcolor);

header("Content-type: image/jpeg");
imagejpeg($img_number);
?>


And upload to my server. Then put the code below into a java/html block:
Code: [Select]
<img src="http://yoursite/image.php" border="1">

And, hey presto, the user's IP Addy.

Now how would you add to that code so it would say something like....

Your Ip address:
255,255,255,200 <--- the actual IP address of course. ;D

Thanks for the code... It works in signatures too.. ;D

gerrymo

  • Guest
Re: Ip adress block !
« Reply #9 on: August 16, 2006, 02:51:04 AM »
Easy enough. Just use html above it. Something like:

Code: [Select]
<p align="center">Your IP address:
<p align="center"><img src="http://yoursite/image.php" border="1">
</p>