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

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

Sending an SMS Message with ASP.NET
Often times it may be a requirement for your web application to send an SMS message. Such examples w

pagination numbering pattern
Hello,

I have following code which works great for pagination. but i have small issue now.

Not Inserting into DB
I can't get my Add new Division form to submit to the database. Anyone see my issue?

Code: &a

Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem. view plaincopy to

Search in the PHP Files
have to search asterisk(*) in the php code of the php files .
In the html page one text box

Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website

Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so

How do I create a 2D game "camera" to follow player?
In J2ME programming I'm targeting MIDP 2.0 devices.

I'm using gamecanvas and I was thinking t

php problem?
I don't think I'm stupid, but maybe I am.

I am working on a sit for a friend I am try to put

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