TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,964
  • Latest: stylix
Stats
  • Total Posts: 195,962
  • Total Topics: 21,317
  • Online today: 1,804
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 742
  • Total: 742

Ip adress block !

Started by evilopinions, January 04, 2006, 06:13:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

evilopinions

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)

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

Ray

Cool I love toys -- works good-- thank you ;D

gerrymo

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.

<?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:

<img src="http://yoursite/image.php" border="1">


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

houston


Cool Surfer


shadrach

rofl, too bad its isp and not IP data

Azraeliitti

Here's the PHP code for showing the actual IP-address:

echo $_SERVER["REMOTE_ADDR"];

gerrymo


Gargoyle

Quote from: gerrymo on January 04, 2006, 12:37:46 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.

<?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:

<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

Easy enough. Just use html above it. Something like:


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

This website is proudly hosted on Crocweb Cloud Website Hosting.