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

Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to a

Array becomes unset by itself?
Hi,

I have a bit of experience with PHP but not extensive. It seems I cannot store any items

help retrieiving results and doing pagination
Having some trouble trying to get the results to show on more than just one page.

What is ha

textfield unchanged
hi,
i want my form to know whether its textbox is unchange or not.

if($textbox == 'unchang

function to return url
Hi,

Can you guys help me giving a function that takes all the contents in a particular field

Add User script "Could not execute query"
This should be an easy script but I can't get it to run. Can someone please help me?

<

Problem with PHP/mySQL login code
Hello,

There is an error in my login script and I can't figure out what it is...
I believe

Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c

need help to creat database
Hello Team, please guys i am stuck from three days with paypal issue for IPN but no luck yet now i w

Slashes
Have a small problem and I'm not able to understand why I'm getting the results I'm getting... and i

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