Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 16th, 2005, 06:24 PM
Registered User
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default undefined variable !!

Having tried PHP4 a few months ago I gave up after most of the scripts failed and displayed errors. Second time round and things seem to be better, installed php4, installed apache and installed phpMyAdmin. Now i have inserted some code into page and it displays a few lines of errors like the one below. When I upload onto my remote server it works fine. I have a feeling that something in my php.ini file needs changing, could anyone put me in the right direction, i also remember changing the path for my host I think in php.ini but the problem is I need to locate it again.......where would this be and what needs changing, also can I make the change via apache console??

Thanks in advance guys


Notice: Undefined variable: Price in C:\Program Files\Apache Group\Apache2\htdocs\listbox.php on line 5
Price Range:

Old January 17th, 2005, 03:10 AM
Registered User
Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

just means that you have to set the variable , variables can't have spaces in them im pretty sure! just put in something lke

$price = whatever

Old January 18th, 2005, 05:50 PM
Friend of Wrox
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts

This problem has to do with register_globals, I believe.

Replace $Price in your code with $_POST['Price'] if your form method is POST and $_GET['Price'] if your form method is GET.


-Snib - http://www.snibworks.com
Where will you be in 100 years?
Old January 20th, 2005, 05:47 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts

Lots of old posts about this topic. Check out the old FAQ from a few years ago on this.

Take care,


Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined variable adel_88 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 July 9th, 2007 03:21 PM
Undefined Variable aspire Beginning PHP 4 July 12th, 2006 07:00 AM
Undefined variable najib Beginning PHP 4 July 1st, 2005 08:12 AM
Undefined Variable fpolan Beginning PHP 9 July 15th, 2004 06:24 AM
Undefined Variable Some Help! knight Beginning PHP 7 February 19th, 2004 07:07 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.