note 72571 added to language.variables.predefined

From: Date: Wed, 24 Jan 2007 19:48:12 +0000
Subject: note 72571 added to language.variables.predefined
Groups: php.notes 
Request: Send a blank email to php-notes+get-122157@lists.php.net to get a copy of this message
I think it is very important to note that PHP will automatically replace dots ('.') AND spaces (' ') with underscores ('_') in any incoming POST or GET (or REQUEST) variables. This page notes the dot replacement, but not the space replacement: http://us2.php.net/manual/en/language.variables.external.php The reason is that '.' and ' ' are not valid characters to use in a variable name. This is confusing to many people, because most people use the format $_POST['name'] to access these values. In this case, the name is not used as a variable name but as an array index, in which those characters are valid. However, if the register_globals directive is set, these names must be used as variable names. As of now, PHP converts the names for these variables before inserting them into the external variable arrays, unfortunately - rather than leaving them as they are for the arrays and changing the names only for the variables set by register_globals. ---- Server IP: 64.71.164.2 Probable Submitter: 65.102.107.60 ---- Manual Page -- http://www.php.net/manual/en/language.variables.predefined.php Edit -- https://master.php.net/note/edit/72571 Del: integrated -- https://master.php.net/note/delete/72571/integrated Del: useless -- https://master.php.net/note/delete/72571/useless Del: bad code -- https://master.php.net/note/delete/72571/bad+code Del: spam -- https://master.php.net/note/delete/72571/spam Del: non-english -- https://master.php.net/note/delete/72571/non-english Del: in docs -- https://master.php.net/note/delete/72571/in+docs Del: other reasons-- https://master.php.net/note/delete/72571 Reject -- https://master.php.net/note/reject/72571 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#122157) next »