By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,635 Members | 1,738 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,635 IT Pros & Developers. It's quick & easy.

Apache/PHP does not recoginize querystring keyvalue pair

P: n/a
Greetings!
I am testing Apache/PHP/MySQL. The connection seems to be right but
when I try to http://my_machine/mypage.php3?id=1", I won't be able to
get value the variable $id. Did I miss anything in the configuration
of Apache or I miss a function call before I check the value of $id in
PHP file?
Please help! Thanks!
Please mail to su******@hotmail.com
-- Kang
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


On 20-Oct-2003, su******@hotmail.com (Kang Sun) wrote:
I am testing Apache/PHP/MySQL. The connection seems to be right but
when I try to http://my_machine/mypage.php3?id=1", I won't be able to
get value the variable $id. Did I miss anything in the configuration
of Apache or I miss a function call before I check the value of $id in
PHP file?


try $_GET['id'] or $_REQUEST['id']

look up register globals in the manual.
--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #2

P: n/a
Kang Sun wrote:
Greetings!
I am testing Apache/PHP/MySQL. The connection seems to be right but
when I try to http://my_machine/mypage.php3?id=1", I won't be able to
get value the variable $id. Did I miss anything in the configuration
of Apache or I miss a function call before I check the value of $id in
PHP file?
Please help! Thanks!
Please mail to su******@hotmail.com
-- Kang

"In PHP 4.2.0 and later, the default value for the PHP directive
register_globals is off. This is a major change in PHP. Having
register_globals off affects the set of predefined variables available
in the global scope. For example, to get DOCUMENT_ROOT you'll use
$_SERVER['DOCUMENT_ROOT'] instead of $DOCUMENT_ROOT, or $_GET['id'] from
the URL http://www.example.com/test.php?id=3 instead of $id, or
$_ENV['HOME'] instead of $HOME.

For related information on this change, read the configuration entry for
register_globals, the security chapter on Using Register Globals , as
well as the PHP 4.1.0 and 4.2.0 Release Announcements.

Using the available PHP Reserved Predefined Variables, like the
superglobal arrays, is preferred."

taken directly from the PHP manaul at
http://www.php.net/manual/en/languag...predefined.php

--
John Downey
http://delusive.dyn.ee
http://sage.dev.box.sk
http://blacksun.box.sk

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.