Getting a Visitor's IP Address

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

Getting a Visitor's IP Address

Post by Bigun »

Is there a way to return user info from a user into some variables, one of them being the user's IP address.

I'm going to be using it to setup banning functions.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

Bad idea. RTFM. Then Google, and if you are still stuck, post again.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Banning an IP is OK as long as you aren't expecting it to work indefinately. If it's just a deterrent or something, that's alright. Just don't count on it to work. Say somebody is using AOL. Their IP will change with every connection (I've read that it can even change from page request to page request!! :? :? )
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

You know what is bad about this topic?

There is another one with almost the same title on the same page and he couldn't read it. :(

No hints.
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

Post by Bigun »

Daedalus- wrote:Bad idea. RTFM. Then Google, and if you are still stuck, post again.
You posted twice... are you that dead bent on trying to get no-one to reply?
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

Post by Bigun »

The Ninja Space Goat wrote:Banning an IP is OK as long as you aren't expecting it to work indefinately. If it's just a deterrent or something, that's alright. Just don't count on it to work. Say somebody is using AOL. Their IP will change with every connection (I've read that it can even change from page request to page request!! :? :? )
I know IP's can change, but I'm coding an agressive banning function.

My suite is almost to the point of heading into the security area and start looking there.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Bigun wrote:
The Ninja Space Goat wrote:Banning an IP is OK as long as you aren't expecting it to work indefinately. If it's just a deterrent or something, that's alright. Just don't count on it to work. Say somebody is using AOL. Their IP will change with every connection (I've read that it can even change from page request to page request!! :? :? )
I know IP's can change, but I'm coding an agressive banning function.

My suite is almost to the point of heading into the security area and start looking there.
Huh? That made no sense to me. What are you talking about?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

$_SERVER['REMOTE_ADDR'] for what it's worth but don't ban based on that. You may well ban an entire country! Yes, you get entire countries heading through proxies.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

That's funny because at my work we did ban an entire country once.

They were attacking the website through a hole that one of the old idiot developers had created.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

btw, I'm dead bent on getting people to do research.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Daedalus- wrote:btw, I'm dead bent on getting people to do research.
What a horrible thing to do
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

learning how to look stuff up is important
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

Post by Bigun »

Daedalus- wrote:learning how to look stuff up is important
So if your broke down on the side of the road... I'll be sure to toss you a Mitchell manual and yell "RTFM" as I drive off.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

First, I would read it, fix my car and then drive down to spit in your face.

This isn't that kind of situation.

Do you know how long it took me to figure this one out?

15 frickin' seconds of searching the manual.

Don't be lazy.
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

Post by Bigun »

Daedalus- wrote:First, I would read it, fix my car and then drive down to spit in your face.

This isn't that kind of situation.

Do you know how long it took me to figure this one out?

15 frickin' seconds of searching the manual.

Don't be lazy.
If you know where to look... or if can even understand how the syntax translates to what you want.

We agree to disagree and that's fine... just don't reply to my posts if they bother you that much.... k?
Post Reply