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,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 322
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 170
  • Total: 170

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>

rctxtreme

How do I change the font?

Gargoyle

Quote from: gerrymo on August 16, 2006, 09:51:04 AM
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>


I was hoping for a way to add it to the image... Is that possible ?

evilicy

Quote from: Azraeliitti on August 15, 2006, 08:43:40 PM
Here's the PHP code for showing the actual IP-address:

echo $_SERVER["REMOTE_ADDR"];

Cool simple and easy ;p

tamasir

#13
You to open html box to the left are to the right .
You copy code.
<center><a href="http://www.wieistmeineip.de/cometo/?en"><img src="http://www.wieistmeineip.de/ip-address/" border="0" width="125" height="125" alt="IP" /></a></center>
I to see the your Ip_Adress.

tamasir~

akulion

nice one tamasir :up:

great job

tamasir

#15
Quote from: Aku on November 07, 2006, 12:03:12 AM
nice one tamasir :up:

great job
Aku!   I Thank . ;)
Thanks: to Crip.  :up:
I to see image, Crip  by site. In the future I to create code.
:laugh: :laugh:
tamasir~

Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



tamasir


tamasir

#18
Quote from: tamasir on November 06, 2006, 11:11:20 PM
You to open html box to the left are to the right .
You copy code.
<center><a href="http://www.wieistmeineip.de/cometo/?en"><img src="http://www.wieistmeineip.de/ip-address/" border="0" width="125" height="125" alt="IP" /></a></center>
I to see the your Ip_Adress.

tamasir~
RebelRose
In  html bloc you copy code. ;)
The code to construct  image .
tamasir~




rebelrose


tomtom9800

Well I copied the exact code block of the code, and it seems that is does not work, all the block shows to me is the code.  I have the most recent .9.8 portal and 1.1.3 SMF.  What am I doing wrong......Also did is as a scriptbox, did I do that right?

FERNSIDEâ„¢

#21
Depends on which code you used mate :)

If you used this one:
<center><a href="http://www.wieistmeineip.de/cometo/?en"><img src="http://www.wieistmeineip.de/ip-address/" border="0" width="125" height="125" alt="IP" /></a></center>

That goes into an html block..

The other codes are for a php block :)

Good luck


Zetan

Quote from: FERNSIDEâ,,¢ on December 12, 2007, 06:43:52 AM

A little tip, is when selecting a new block, choose a php or something. Add the code, and before you save it, change it to an html block..


Can you explain, why and how this is a useful tip?

FERNSIDEâ„¢

Ooops, got it mixed up..

Was actually refering to when I have to edit it after.
I cannot do it while the block is in html, as the image is there instead.

My baad..   Deleted.

This website is proudly hosted on Crocweb Cloud Website Hosting.