/    Sign up×
Community /Pin to ProfileBookmark

Register Globals setting & Superglobals

Maybe my understanding of this is wrong, but has anyone seen a server setup where ‘register globals’ is set to off, but the Superglobal arrays $_GET[] and $_POST[] return no data from HTML form inputs? In fact, the only way to retrieve posted form data is to use the global post variable name (as you would, ironically, if ‘register globals’ was on). I.e., $_POST[‘name’]; is emtpy, however $name would have the data in it. Seems totally backwards to me, but maybe I’m the one who’s backwards?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@bokehAug 08.2005 — Register globals 'off' means you must use $_POST $_GET $_REQUEST etc while register globals 'on' can also access data directly using variable name. For example 'off' use only $_POST['name'], or when set to 'on' use $name.

Does this clarify?
Copy linkTweet thisAlerts:
@grailquester5authorAug 08.2005 — Yes - but the issue is that $_POST[] is always empty, regardless of register globals status. The PHP version is (supposedly) 4.2.0., so my understanding is that $_POST[], $_GET[], $_REQUEST[], etc., should always be available. However, they are always empty. Maybe I'll try $HTTP_POST_VARS[] and see if that works. Any idea if there is a server setting which disables $_GET[] and $_POST[]?
Copy linkTweet thisAlerts:
@grailquester5authorAug 08.2005 — Ah-ha! Although the hosting company says "PHP 4.3" with register globals OFF, the actual truth (shown via phpinfo()? is that the version is 4.0 with register globals ON. Which would mean that $_GET[] and $_POST[] don't exist and I need to use $HTTP_POST_VARS[] instead. Nothing like a server admin who doesn't know what they're doing!
×

Success!

Help @grailquester5 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...