473,668 Members | 2,330 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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******@hotmai l.com
-- Kang
Jul 17 '05 #1
2 2677


On 20-Oct-2003, su******@hotmai l.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*********@wil lglen.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******@hotmai l.com
-- Kang

"In PHP 4.2.0 and later, the default value for the PHP directive
register_global s is off. This is a major change in PHP. Having
register_global s 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_global s, 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
3044
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 %Systemroot%\php.ini - however, only when I execute ini_get('SMTP') in a php page on the Apache server I get the value from PHP.ini - which is test.com.
7
9585
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 put the phpinfo.php file is in /var/www/html and I try to access it through the browser, I get the content of the file and not the execution of the file. Instead of display the info of PHP, I got the text of the file as:
0
2702
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 @CodePage = 65001 to an ASP page makes the ASP page decode UTF-8 data in query string properly. Without the directive, Request.QueryString(var) returns garbled data. With the directive, Request.QueryString(var) decodes UTF-8 encoded data properly. (I tried
12
5286
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 ... www.something.com/main.aspx?client Client is the QueryString, but no value is given. This would mean to me that client exists, so its value is true. In the code behind, I can tell that client exists using Request.QueryString.Keys.Count, which equals 1....
2
1660
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 sPage query string value, it returns myTargetpage.asp?qs=1 and clips the 2nd querystring value pair. Can someone help me construct a link so myPopUp.asp preserves the entire query string? I tried using the Server.HtmlEncode comand in "FAILED...
5
1932
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 appears that the server is actually calling the script http://localhost/tag.php (which is a real file). However, when I do something like http://localhost/nonexistantfile/
6
1700
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 reading the anchor name as part of the number. e.g. http://www.fluidstyle.co.uk/venuedetails.aspx?venueID=1964#review
1
1326
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 like this for Name="A&S". Hy1.NavigateUrl = "javascript:CenteredWin('MyPage.aspx?keyvalue=" & Server.UrlEncode(mData.Name) & "','MyPage',600,500);"
2
2453
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 default web page to display my projects. I want to be able to pass a link like this: www.joeswelding.biz/index.htm?page=projects
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8799
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.