473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Apache/PHP does not recoginize querystring keyvalue pair

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
2 2659


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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Flemming Joensson | last post by:
I have an odd problem. I use PHP 4.3.2 I use Apache 1.3.28 on port 8080 I use IIS5 in Win2k on port 80 Both Apache and IIS use the same PHP version, and I thought they both read the...
7
by: Phong Ho | last post by:
I have this problem with PHP that someone might be able to help. With CLI, I am able to execute my .php files. For example, if I type "php phpinfo.php" , this works fine on my system. If I...
0
by: Samuel Fung | last post by:
Hi all, Can ASP retrieve UTF-8 encoded data in query string properly, when used with IIS 5.0 on Windows 2000 Pro/Server? With some trial and error, it seems that adding the directive...
12
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... ...
2
by: Scott | last post by:
I'm trying to create a link (SEE LINK BELOW) to a pop-up window (myPopUp.asp). My problem is my sTargetPage variable is a url containing a querystring variable. When myPopUp.asp opens and I get my...
5
by: raisins | last post by:
This is kind of an obscure question, and I hope someone has a clue what's going on. I've got PHP4 running on Apache 1.3 on win32, and whenever I request a URL like so: http://localhost/tag/ It...
6
by: duncan.welch | last post by:
Hi, I've got a website that uses links for page positioning which works great about 99% of the time. For some reason, 1% of the time I'll get an error when parsing the querystring, as it's...
1
by: Joe Fallon | last post by:
I Googled this topic and everyone says to use Server.UrlEncode. No sweat - I did that. Still doesn't work right though! Could use some advice. On the page where I build the link I have code...
2
by: jp2express | last post by:
Does Request.QueryString need to be carried out using ASP, or can JavaScript handle this? I know it is simple, but I've never done it and I don't know what to search for. Say I wanted my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.