Re: [PHP] Problem with Square Brackets [was: php+ ajax]

2006-02-21 Thread Jochem Maas

SIDENOTE TO JAY
add to your list of potential book topics?:

knowing when to successfully break the rules.
(i.e. when to not follow the standards)
/SIDENOTE TO JAY

From a php developer point of view there is one
big problem with 'follow the standards' mantra as
far as square brackets go (with regard to use in the
value of name attributes of form fields) ...

namely if you following the standard you can't use
the array translation capability of php with regard to
incoming request variables.

here is a url from a CMS of mine:

/manager.php?e[n]=articlee[kf][ARTICLE_ID]=186e[f][n]=bundlese[f][kf][BUNDLE_ID]=12427e[f][f][n]=bundledartse[f][f][kf][BUNDLE_ID]=12427e[f][f][kf][BUNDLED_ID]=477a=2

it's dynamically generated and uses a nested array structure
to describe a 'path' to whatever entity (or list of entities) is being
requested (list, edit, etc) -- it works, it's flexible and
I wouldn't have a clue where to start refactoring this so that
the square bracket 'magic' is no longer required.

David Dorward wrote:

--- Kim Christensen [EMAIL PROTECTED] wrote:



On 2/21/06, Jochem Maas [EMAIL PROTECTED]
wrote:




Kim do the escaped sqaure brackets work in
all majors browsers as far as you know?




Major browsers as in Firefox and IE for PC/Mac
works great, yes -



Many browsers are amazing at being able to compensate
by errors made by authors, but that shouldn't be taken
as an excuse to not treat the errors as anything other
than something that should be fixed.

You can't test in every browser out there - there are
too many. You can't test in any browser that hasn't be
written yet.

Writing code that ignores the standards is just asking
for maintainance headaches and other troubles down the
line.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with Square Brackets [was: php+ ajax]

2006-02-21 Thread David Dorward
--- Jochem Maas [EMAIL PROTECTED] wrote:
  From a php developer point of view there is one
 big problem with 'follow the standards' mantra as
 far as square brackets go (with regard to use in the
 value of name attributes of form fields) ...

Nope. The names of form controls MAY contain square
brackets, it is the ids that may not (and the name and
id attributes do NOT need to have the same value).

-- 
David Dorward
http://dorward.me.uk/

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with Square Brackets [was: php+ ajax]

2006-02-21 Thread Jochem Maas

David Dorward wrote:

--- Jochem Maas [EMAIL PROTECTED] wrote:


From a php developer point of view there is one
big problem with 'follow the standards' mantra as
far as square brackets go (with regard to use in the
value of name attributes of form fields) ...



Nope. The names of form controls MAY contain square
brackets, it is the ids that may not 


AHA! - I seem to have read the specvs incorrectly - the 'id' attribute
is defined as 'W3C datatype' NAME whereas the 'name' attribute (atleast as
far as the FORM, INPUT  SELECT tags are concerned) is of 'W3C datatype' CDATA.

the CDATA type allow ssquare brackets ofcourse = which means
the php choice of using the square brackets is AOK. :-)

SIDENOTE TO JAY
the 'when to break the rules' idea still stands in theory :-)
/SIDENOTE TO JAY


(and the name and id attributes do NOT need to have the same value).


that I know - I mentioned that myself in a previous post.





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php