ip loggs

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

BenCollo
Forum Newbie
Posts: 10
Joined: Wed Sep 10, 2003 9:24 am

Post by BenCollo »

wa do u mean by wa ones do i have?
BenCollo
Forum Newbie
Posts: 10
Joined: Wed Sep 10, 2003 9:24 am

Post by BenCollo »

like every thin?
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

urmm, now you're confusing us again.

Well, I guess everything related to the current question you're asking.

-Nay
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Please type in English or don't bother. It's a pain trying to read your posts - txt speak is for mobiles, you aren't limited to a few hundred characters on this forum so you don't need to abbreviate everything.

Mac
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

i find it VERY hard to believe you read thelinked thread. or that you read the partiular points i brought to your attention. or this: http://www.catb.org/~esr/faqs/smart-que ... l#examples

why? your response. you came here looking for someone to just GIVE you stuff.

in my humble opinion Nay was WAY to polite. she shouldn't have given that much considering how you responded to the one who pointed you to $_SERVER['REMOTE_ADDR']
BenCollo
Forum Newbie
Posts: 10
Joined: Wed Sep 10, 2003 9:24 am

Post by BenCollo »

ok sory i need to know how to log people's ip's passwords and user names i dont have any think related to it i just have a simple site Http://www.vibe-tech.co.uk
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Do you wanna grab alll this info when someone logs in?

Seeing as you are using PHPNuke, you will already have the usernames and passwords in the Database.

Grabbing IP is easy, just look into $_SERVER['REMOTE_ADDR'] mentioned by Nay.

Mark
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

BenCollo wrote:ok sory i need to know how to log people's ip's passwords and user names i dont have any think related to it i just have a simple site Http://www.vibe-tech.co.uk
OK, I told you about $REMOTE_ADDRESS, Nay told you about $_SERVER['REMOTE_ADDR']

Go to php.net for details.

Then I asked what you want to log to, no answer.

If you want to log to a file, then use the FOPEN command to write stuff to a text file. php.net has examples of how to use FOPEN.
BenCollo
Forum Newbie
Posts: 10
Joined: Wed Sep 10, 2003 9:24 am

Post by BenCollo »

ok and is that how you find there passwords out aswell?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

which passwords are you talking about?

the one they use to log into your site?

Mark
BenCollo
Forum Newbie
Posts: 10
Joined: Wed Sep 10, 2003 9:24 am

Post by BenCollo »

the passwords that people use to log into my site
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Uh-oh. I think I can see where this is going...
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

BenCollo wrote:the passwords that people use to log into my site
Your script handles that. Its basic HTML. You ask for a password on the form, the form passes it to a script. PHP makes it a variable, and you write it to a file.
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

m3rajk wrote:i find it VERY hard to believe you read thelinked thread. or that you read the partiular points i brought to your attention. or this: http://www.catb.org/~esr/faqs/smart-que ... l#examples

why? your response. you came here looking for someone to just GIVE you stuff.

in my humble opinion Nay was WAY to polite. she shouldn't have given that much considering how you responded to the one who pointed you to $_SERVER['REMOTE_ADDR']
does my name sound like a girls'?.......

.........

for your information, I'm a guy.

Forget about it.

-----------------------------------------------

Okay, I think I see where you're going.

You're trying to do a log in script, that also gets the IP of the person logging in, right?

Here's how to go about it:

- Get user information from a form and post it.
- Connect to MySQL, and get the row matching the information.
- If there are no rows returned, echo log in failed, or so.
- If there is a match, then get the user's IP.
- Then store it into a MySQL table.
- Start a session.
- Store the username or some information into the session.
- Redirect the user to the protected page.

Check for the variables in the session on the protected pages. I've got the script lying around somewhere in my hard drive, but I'd rather let you learn how to do it.

-Nay
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Nay wrote:does my name sound like a girls'?.......
Everybody tends to assume I'm a guy, you can never get these things right on the internet can you :lol: .

Mac
Post Reply