php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9924 Warning: Undefined index: Service[1]
Submitted: 2001-03-22 09:57 UTC Modified: 2001-03-23 08:14 UTC
From: john at neutralize dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.0.4pl1 OS: Windows 98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: john at neutralize dot com
New email:
PHP Version: OS:

 

 [2001-03-22 09:57 UTC] john at neutralize dot com
I am dynamically creating input fields in my form with their values stored in an array:

<input type="Hidden" name=Service[<?php echo $counter ?>] value=<?php echo odbc_result($result, "ServiceId") ?>>

These submit fine but I am having trouble accessing the results of the array from the post variables:

$serviceId = $HTTP_POST_VARS["Service[".$counter."]"];

Do I need to use unicode decompression before referencing the variables or am I just building the reference wrong?

Have looked at PHP help but only tells you how to use arrays in form variables not how to retrieve them.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-22 10:14 UTC] hholzgra@php.net
i would suggest that you put qoutes arround *all*
tag attribute values:

<input 
  type="Hidden" 
  name="Service[<?php echo $counter ?>]"
 value="<?php echo odbc_result($result, 'ServiceId')?>"
>

and you could use var_dump($HTTP_POST_VARS) 
and the generated HTML code to further analyse 
the cause of the problem?
 [2001-03-23 08:14 UTC] sniper@php.net
send twice.. (#9926)

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 03:01:24 2019 UTC