473,508 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

isset fails, getenv succeeds (Apache configuration problem?)

I'm not sure whether the following is a problem with PHP or my Apache
server. Minimal example:

<?php
if (isset($dummy))
echo "Set.";
else
echo "Not set.";

echo "\n</br>".getenv("QUERY_STRING");
?>

With this URL:
http://localhost/minimal.php?dummy=5

Produces:
Not set.
dummy=5
isset works as expected when I run this on a different server (Windows
something, with an older PHP version, sorry I don't know the
specifics). Can anybody say whether this is a problem with my PHP
installation or my Apache installation?

Thanks,
Adam

Sep 3 '07 #1
2 2441
On Mon, 03 Sep 2007 23:32:25 -0000, Adam Baker <ad******@gmail.comwrote:
>I'm not sure whether the following is a problem with PHP or my Apache
server. Minimal example:

<?php
if (isset($dummy))
[snip]
>
With this URL:
http://localhost/minimal.php?dummy=5

isset works as expected when I run this on a different server (Windows
something, with an older PHP version, sorry I don't know the
specifics). Can anybody say whether this is a problem with my PHP
installation or my Apache installation?
It's really a problem with your code, see: http://uk3.php.net/register_globals

You're using a feature that was disabled by default about 5 years ago for
several good reasons. You can re-enable it, but that's not a good idea; see
previous link for how.

See also http://uk3.php.net/manual/en/languag...s.external.php

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 3 '07 #2
As stated already, you can not access form vaiables directly anymore
and instead you should be using the $_GET/$_POST superglobal arrays,

So to access the variable set in your URL, which is a GET query string
you would use:

$dummy = $_GET['dummy'];

Or for your example:

if (isset($_GET['dummy'])){
echo "Set";
} else {
echo "Not Set";
}

Sep 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3271
by: Kevin Sagon | last post by:
I am running a J2EE Web App under Tomcat 4.1 with Apache 2.0 proxying requests. Everything is configured and working appropriately however I ran into a problem after configuring J2EE Form...
1
2665
by: Colm Dobbs | last post by:
Hi Guys, I'm currenlty involved in a port of our gateway code from a Solaris 8 environment to a HP-UX11.11 incorporating postgresql-7.3.3. We're having some problems with creation and opening of...
4
3769
by: CompGeek | last post by:
Hi there, I am trying to load a file with 1729 records into a DB2 UDB EEE 7.1 DataBase (on AIX 4.3) which is across two partitions. The partitioning key is BI_INSTITUTIONAL_KEY which is a BIGINT...
6
8443
by: Rolf Schroedter | last post by:
(Sorry for cross-posting). I need to access large files > 2GByte (Linux, WinXP/NTFS) using the standard C-library calls. Till today I thought I know how to do it, namely for Win32: Use open(),...
3
1654
by: maria.s | last post by:
Hi, I've got a problem with an LDAP query submitted from my ASP.NET application. Configuration: Windows 2003 Server Standard Ed., the application uses Windows Integrated Authentication and is...
6
7958
by: MaiyaHolliday | last post by:
Hello, I've recently installed apache on a new computer, and cannot figure out why my site will not process any includes. (it was working on my old one) There are no errors on the page such as...
2
8128
by: =?Utf-8?B?TGVuc3Rlcg==?= | last post by:
A C# (.NET 2) application which uses the System.Net.HttpWebRequest object to request a resource over HTTPS is failing following the installation of a new proxy server on our internal network with...
2
2636
by: john6630 | last post by:
When I run the following code, I get "Undefined variable: localPath" error. I do not understand why? It seems simple enough...but I am new to PHP so any help is appreciated. I am running PHP...
6
7580
by: josequinonesii | last post by:
I've searched, I've read, I've tested and re-read numerous post but to no avail yet... Quite simply, the settings I've applied to my httpd.conf, httpd-vhost.conf and my hosts files simply does not...
0
7227
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
7127
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
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7391
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
7501
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...
1
5056
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...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
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 ...
1
768
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.