From: <ja...@ho...> - 2007-01-24 22:36:26
|
I don't know if .'s are valid in variable names.. ?.. I know its not encouraged.. >From the manual: http://us3.php.net/manual/en/language.variables.php Basics Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' Note: For our purposes here, a letter is a-z, A-Z, and the ASCII characters from 127 through 255 (0x7f-0xff). Also worth noting: http://cvs.php.net/viewvc.cgi/php-src/CODING_STANDARDS?view=3Dco > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Wed, Jan 24, 2007 at 02:08:41PM -0600, Sarah Gray wrote: >> Does anyone know why it is that a form element named using dots is >> transliterated to a form element named using underscores when it is >> posted using PHP [4.4.4 and 4.3.2, at least]? It's as if php runs a >> pre-filter preg_replace on the names of input fields before outputting >> them to the $_POST array. > > That's pretty much exactly what happens. Because of register_globals, > the keys have to be valid variable names. $name.with.dots is invalid, > but $name_with_dots is OK. This alteration was carried over into $_POST > and the others. > > > - -- > Peter Harkins - http://push.cx - http://cambrianhouse.com > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (GNU/Linux) > Comment: If you don't know what this is, it's OK to ignore it. > > iD8DBQFFt9ABa6PWv6+ALKoRAgpQAJ9gsZlRWOXWvQZ7fwVbXknKoUQMcwCdH8ZH > kLqCrp8XXvL6J1X0fYkm810=3D > =3DGF1M > -----END PGP SIGNATURE----- > > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > |