July 13, 2011, 9:28 p.m.
posted by stackme
Handling Remote Variables with Periods in Their Names
Replace the period in the variable's name with an underscore. For example, if you have a form input element named hot.dog, you access it inside PHP as the variable $_GET['hot_dog'] or $_POST['hot_dog'].
During PHP's pimply adolescence when register_globals was on by default, a form variable named hot.dog couldn't become $hot.dog'periods aren't allowed in variable names. To work around that, the . was changed to _. While $_GET['hot.dog'] and $_POST['hot.dog'] don't have this problem, the translation still happens for legacy and consistency reasons, no matter your register_globals setting.
You usually run into this translation when there's an element of type image in a form that's used to submit the form. For example, a form element such as <input type="image" name="locations" src="locations.gif">, when clicked, submits the form. The x and y coordinates of the click are submitted as locations.x and locations.y. So in PHP, to find where a user clicked, you need to check $_POST['locations_x'] and $_POST['locations_y'].
Documentation on variables from outside PHP at http://www.php.net/language.variables.external.