473,765 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Ap ache2\htdocs\so nja
\test.php on line 14
Notice: Undefined variable: folder in F:\WEBSERVER\Ap ache2\htdocs\so nja
\test.php on line 15
Notice: Undefined variable: navColor in F:\WEBSERVER\Ap ache2\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 3447
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*@torusdesig n.nlwrote in message
news:7ulni.996$ Rv4.592@amstwis t00...
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\Ap ache2\htdocs\so nja
\test.php on line 14
Notice: Undefined variable: folder in F:\WEBSERVER\Ap ache2\htdocs\so nja
\test.php on line 15
Notice: Undefined variable: navColor in F:\WEBSERVER\Ap ache2\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*@torusdesig n.nlschreef in bericht
news:7ulni.996$ Rv4.592@amstwis t00...
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_globa ls':

http://nl2.php.net/register_globals

If 'register_globa ls' 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_globa ls' 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
2708
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 something like this: for int in range(2, 9): use... conn+str(int) {I'm passing it into another
0
3413
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 = $q->Vars;
48
3091
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
2176
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 window and call the form. In this particular instance, a city name is what I have to pass to the form Chapter.htm. <html> <head>
8
1436
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 function foo() { var myVar = 5; var myOtherVar = 'bla'; showVars( {myVar: myVar, myOtherVar: myOtherVar} );
1
3291
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 in my script, and I am getting this error: Software error: Undefined subroutine &main::Vars called at /web/lubbockonline.com/cgi-bin/notice.cgi line 6 In my form the input 'NAME' of the radio buttons is 'sorry' and the 'VALUES' are the...
20
7000
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 = document.getElementById('hometab'); Has anyone ever seen anything like this before, or am I dreaming?
9
1996
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); ...more phpcode..
4
6339
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 Notice: Undefined index: args in /home/mattehz/public_html/acssr/trunk/inc_error.php on line 92 Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_error.php on line 92
0
9568
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
9404
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,...
1
9959
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,...
0
9837
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
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...
1
3929
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
3532
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.