/    Sign up×
Community /Pin to ProfileBookmark

Problem with REMOTE_ADDR and HTTP_REFERER

I have installed MAMP and I having some problems with php.
it doesn’t work correctly.

Variables like REMOTE_ADDR, HTTP_REFERER are undefined.

(Notice: Undefined variable: HTTP_REFERER…..)

(Undefined variable: REMOTE_ADDR….)

Please help me !!!!
Thank you.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 23.2008 — $_SERVER['HTTP_REFERER'] and $_SERVER['REMOTE_ADDR'], although note that the http-referer header is optional and is never guaranteed to be set (plus can be easily spoofed).
Copy linkTweet thisAlerts:
@spyrosauthorMay 23.2008 — In my php.ini file the register_global is on but in my phpinfo it shows that is off how it is that possible ?

I have restart my server

Thank you
Copy linkTweet thisAlerts:
@NogDogMay 23.2008 — In my php.ini file the register_global is on but in my phpinfo it shows that is off how it is that possible ?
[/quote]

Option 1: You modified the wrong php.ini file (see which file the phpinfo() data says it's using.

Option 2: You have a local per-directory override in a .htaccess file.

Option 3: I don't know.

In any case, since register_globals is deprecated and will not even be an option in PHP 6, it would be best to turn it off and write your code to not depend on it. (After all, they deprecated it and made the default setting "off" for a reason.)
×

Success!

Help @spyros spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...