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

Undefined variable passing vars locally via URL

P: n/a
I've recently installed Apache 2 and php 5.2 on my WIndows XP
machine. Everything is up and running.

I'm passing some vars via the URL. It works fine online:
http://www.torusdesign.nl/spry/test....childerijenNAV

This is the code:
<?php echo $folder; ?>
<?php echo $navColor; ?>

The problem is that when I test it locally I get an error that the
variable in undefined.
Notice: Undefined variable: folder in F:\WEBSERVER\Apache2\htdocs\sonja
\test.php on line 14
Notice: Undefined variable: folder in F:\WEBSERVER\Apache2\htdocs\sonja
\test.php on line 15
Notice: Undefined variable: navColor in F:\WEBSERVER\Apache2\htdocs
\sonja\test.php on line 32

Can someone please help me out. Is there something wrong with my local
php configuration?

PS. You'll notice the Hello World at the top. That does work locally.
(if that's any help)

--
*******************

Bob Bruyn
Torus Design
Argonautenweg 45
3054 RP Rotterdam
010-4184349
http://www.torusdesign.nl
Jul 18 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I have it already:

<?php echo $_GET['folder']; ?>

instead of

("<?php echo $folder; ?>
--
*******************

Bob Bruyn
Torus Design
Argonautenweg 45
3054 RP Rotterdam
010-4184349
http://www.torusdesign.nl
"Bob Bruyn" <bo*@torusdesign.nlwrote in message
news:7ulni.996$Rv4.592@amstwist00...
I've recently installed Apache 2 and php 5.2 on my WIndows XP
machine. Everything is up and running.

I'm passing some vars via the URL. It works fine online:
http://www.torusdesign.nl/spry/test....childerijenNAV

This is the code:
<?php echo $folder; ?>
<?php echo $navColor; ?>

The problem is that when I test it locally I get an error that the
variable in undefined.
Notice: Undefined variable: folder in F:\WEBSERVER\Apache2\htdocs\sonja
\test.php on line 14
Notice: Undefined variable: folder in F:\WEBSERVER\Apache2\htdocs\sonja
\test.php on line 15
Notice: Undefined variable: navColor in F:\WEBSERVER\Apache2\htdocs
\sonja\test.php on line 32

Can someone please help me out. Is there something wrong with my local
php configuration?

PS. You'll notice the Hello World at the top. That does work locally.
(if that's any help)

--
*******************

Bob Bruyn
Torus Design
Argonautenweg 45
3054 RP Rotterdam
010-4184349
http://www.torusdesign.nl

Jul 18 '07 #2

P: n/a

"Bob Bruyn" <bo*@torusdesign.nlschreef in bericht
news:7ulni.996$Rv4.592@amstwist00...
I've recently installed Apache 2 and php 5.2 on my WIndows XP
machine. Everything is up and running.

I'm passing some vars via the URL. It works fine online:
http://www.torusdesign.nl/spry/test....childerijenNAV

This is the code:
<?php echo $folder; ?>
<?php echo $navColor; ?>

The problem is that when I test it locally I get an error that the
variable in undefined.
Hello Bob,

Since your example works on the live server (which is even worse than it
working on a development server), I would advise you to read up on the ini
file directive 'register_globals':

http://nl2.php.net/register_globals

If 'register_globals' is set to 'on' an end user can easily inject your
application with variables of their choice like so:

http://www.torusdesign.nl/spry/test.php?userid=1

So I strongly advise you to turn off 'register_globals' on the live server.

HTH
Jul 18 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.