473,396 Members | 2,102 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.

Undefined variable passing vars locally via URL

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

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

Similar topics

3
by: Marc | last post by:
Hi all, I can't remember how to do this. I have several instances of telnet connections that I label conn2,conn3, etc. Later when I want to scroll through all of these I wanted to do...
0
by: Mark | last post by:
I want to store my request variables as a hash and have the code: use CGI qw(:standard); use CGI qw(:cgi-lib); use CGI::Carp qw(fatalsToBrowser); use strict; my $q = new CGI; my $params =...
48
by: marbac | last post by:
Hi, i heard a lot about "undefined behaviour" in this and other newsgroups dealing with c/c++. Is there a list where all cases with undefined behaviour in C++ are listed? regards marbac
5
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the...
8
by: Thomas Mlynarczyk | last post by:
Hi, I want to pass a variable to a function and that function should display both the value and the name of that variable. As for the value - no problem, but the name? So far I've come up with ...
1
by: conglomco | last post by:
I a trying to make a form that displays the results of radio buttons, to the user, and at the same time parses the results to an html file to be uses on a larger page. I have some debugging commands...
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
9
by: Erwin Moller | last post by:
Hi all, Is it possible (PHP5.2) to find the name of a variable used in the caller of a function from within the function itself? Or to be more clear: ...php code.. $result = foo($abc);...
4
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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
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...

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.