News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Your IP is

Started by Skoen, July 12, 2004, 09:51:05 AM

Previous topic - Next topic

Skoen

I have until today been using iframe to include a file which could reveal the user's IP address to himself.. The same as $REMOTE_ADDR; does. Problem is that I don't know how to script this into SMF without having to use iframe.
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


[Unknown]

Umm, do you see your IP next to your post?

-[Unknown]

Skoen

#2
Yes, I do.
But when I insert the ' . $message['member']['ip'] . ' in the index.template.php beside Your IP is, I get this message:

Notice: Undefined variable: message in /hsphere/local/home/dataport/dataportalen.com/forum/Themes/SA light/index.template.php on line 219


Line 219:                                                                                                                                                   Din IP er: ' . $message['member']['ip'] . ' <br />';
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


[Unknown]

Oh, you just want to do it anywhere?

I'm not sure if that's available or not... if it is, it would be $context['user']['ip']...

-[Unknown]

Skoen

Yeah, I wanna use it anywhere..
When I inserted that one I got this error message:
QuoteNotice: Undefined index: ip in /hsphere/local/home/dataport/dataportalen.com/forum/Themes/SA light/index.template.php on line 219
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Grudge

In index.template.php I believe $user_info is available - that has the IP in it ($user_info['ip'])
I'm only a half geek really...

Skoen

Nope, that caused an undefined variable error :P
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Grudge

add $user_info to the list of globals at the top of the template function...
I'm only a half geek really...

Skoen

Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


Vinoth

Thanx , i am also adding it now/
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

Advertisement: