When file included, REMOTE_ADDR is server's?


Posted on 16th Feb 2014 07:03 pm by admin

I have an index file that handles my site, basically index.php?page=ip will activate "require('./ip.php')".

In the included file I have $ip = $_SERVER['REMOTE_ADDR']; and when it FIRST displays, it displays "10.15.15.254" or similar, the server's IP! I have tried doing: $ip = $_SERVER['REMOTE_ADDR']; //before require, so IP variable is passed
require('./ip.php'); in the INDEX and allowing the required file to take it, but it still does it. It turns to the user's actual IP when they refresh etc. Why?

No comments posted yet

Your Answer:

Login to answer
202 Like 33 Dislike
Previous forums Next forums
Other forums

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

PHP Redirecting
Hello everyone. Is there a way to redirect people to pages within a statement in PHP? Since there is

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:

Code: $query = "SE

Help with writing "$" with fopen
I just can't get my syntax correct. Could someone help me please? I am trying to write a connect fil

Form validation with functions
Hi there

I am trying to make a very simple form validation function. I currently have the fol

Multiple forms on the same page (safari)
Hello everyone,

I have 3 forms on the same page, that opens in a new window and submits to a

help with image text
Hi ...

see i need the text of the name and number to start in the center and always be in the

What do you call the "token" thing?
You know how some sites have links that run on tokens? Tokens are links that only stay alive for a c

Drop Down and text box issue
Is it possible to set a drop down list and text boxes to a certain width?

here is my code

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash