Log in

View Full Version : Ip thats shows on site.



curious5
06-28-2007, 06:35 AM
Hiya i am very new to this forum and to be honest my intelligence is not that great with codes, i have see websites that when you go into them it tells you or shows you own ip on the page.
Any help would be appreciated if you know what im talking about, Thanks.:)

djr33
06-28-2007, 09:07 AM
Use PHP, like this:
<?php echo $_SERVER['REMOTE_ADDR']; ?>

curious5
06-28-2007, 10:52 AM
Hello thank you i copy and pasted this <?php echo $_SERVER['REMOTE_ADDR']; ?> into my site but when i save and check i can not see anything come up..
Sorry i told you im new at this, also u may need to know that i dont do my own html im using yahoo web builder.

There is a thing i can use to put scripts in as i have others on my site that work well.

Thankyou

P.S This is what i am meaning: I would like to show visitors IP address when they visit my website. I am hoping this will help alieviate some of the problems I am having by those that think they can hide their IP by coming to my site via annoymous sites and such for the purpose of cyber squatting on my website for hours at a time and using up my bandwidth or attempting to hack it.

Does anyone know of a script that uncovers their actual IP address, like what I find in my access log? I want it to come up on my website for them to see when they visit. I'm thinking if they see they aren't masking their ID, maybe they'll wont cause any trouble???

alexjewell
06-28-2007, 03:09 PM
You'll have to change the file type to .php...not .html or .htm or something. In order for the PHP code to work, you have to make the file a PHP file.

So then, wherever you want the IP address to show up, use the code djr33 gave you.

Twey
06-28-2007, 04:28 PM
I don't think Yahoo supports PHP.

djr33
06-28-2007, 08:25 PM
Right. PHP won't work on Yahoo, nor will any other language that would show the IP. The only real option would be to use a secondary server, and embed an element from that server into your page, such as an iframe or a dynamic image that shows the IP.

As for uncovering the real IP, no, that is not possible. You get a request from an IP, and that IP must be known to you. However, if the person is behind a proxy, you simply get the IP of that proxy, then send the data back to that proxy. The proxy in turns knows the real IP, then sends it to the computer, etc. If you've done any networking, it's the same way. One overall IP, but then many sub-IPs for each computer, etc.
The only way to find the real IP would be to gain access to the proxy itself, to check what it is using as the IP, which could, even then, be just another proxy.

curious5
06-28-2007, 10:15 PM
Thank you all for your replies i do apprciate it.

I guess all i can do is put up "IP logged"

Jas
06-28-2007, 10:26 PM
lol. That would not fool many people who actually pay attention to things like the URL (php, like other server side langs, has a different extension then .html; PHP uses .php).

curious5
06-28-2007, 11:42 PM
Dont laugh plz, i dont know what to do i asked for advise not to be laughed at.
Is this how this forum works?
I shall find a new forum.

djr33
06-28-2007, 11:47 PM
I don't think he meant any harm.

I actually think that might fool some people, BUT...
1. I'm not sure how many people will really pay that much attention to it in the first place. After all, think about how many people do illegal file sharing daily.
2. Jas has a point about the extension, though .htm pages can have, through several methods, server side programming, but it's rare.
3. Someone who knows something about web design would know that geocities specifically doesn't allow that type of coding, so in that case, they would know it's not true.

But even if people suspect it isn't true, it might make them think twice about it.

curious5
06-29-2007, 12:02 AM
Thank you but i use stat counter so the IP's are logged.

djr33
06-29-2007, 02:37 AM
Well, in that case, it makes sense to put it there.
You might want to put it near the stat counter, to show the connection, which might validate it's claim.

Twey
06-29-2007, 11:21 AM
Here:
<script type="text/javascript" src="http://www.twey.co.uk/showip.js.php"></script>

Jas
06-29-2007, 06:54 PM
My apologies. I didn't mean it like that. I simply meant that the idea would not be effective against most people who intend to do whatever you are afraid of them doing. Sorry for the offense. If you are logging it, then it should work fine.

DD is great BTW, so don't leave just because of me :) .