Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 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 October 13th, 2003, 06:38 AM
Registered User
 
Join Date: Sep 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listboxes with Multiple Values

Can anyone help me with Listboxes that have multiple values.
In the HMTL page they are setup as an array i.e

<SELECT NAME="Hobbies[]" MULTIPLE>
  <OPTION VALUE=1> Football </OPTION>
  <OPTION VALUE=2> Rugby </OPTION>
</SELECT>

How do I read the values in from this page?

I get the following error:

Notice: Undefined variable: Hobbies in c:\inetpub\wwwroot\php\Forms\Listbox\ListBox.php on line 4

Which means that the array has not been setup and it is not reading the values in from it :<

Can anyone suggest to me how to do this?

Thanks,

joanncae

 
Old October 13th, 2003, 12:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your problem is most likely due to your register_globals setting. If you're trying to access $Hobbies as a global variable, then you're assuming PHP has copied all request variables into global scope. You should actually access them via the request variables superlgobal arrays $_GET or $_POST.

More info:
  http://p2p.wrox.com/archive/beginnin...2002-11/17.asp

This is the most common problem on these lists. For additional links, search:
  http://www.google.com/search?q=site:...gister_globals


Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Values In One Field lefty4080 Access 1 December 12th, 2007 08:59 AM
Listboxes Sub-Listboxes and Table Linking MJB05 Access 4 September 20th, 2005 12:37 PM
How t o insert multiple values qazi_nomi Access ASP 2 May 3rd, 2005 12:45 AM
Multiple Return Values Colonel Angus SQL Server 2000 2 June 2nd, 2004 09:11 AM





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