note 4411 modified in Variables from outside PHP by ronabop

From: Date: Fri, 25 Aug 2000 08:30:23 +0000
Subject: note 4411 modified in Variables from outside PHP by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-3139@lists.php.net to get a copy of this message
You can also access a form element named $required-email in PHP with ${'required-email'}. I found this out while working with someone's form where all the element names had spaces in them! In addition to translating .'s in variable names to _'s, spaces are also translated to _'s. Granted, I don't believe spaces are technically legal in element names, but it works on every browser I've seen. So for <INPUT ... NAME=""This is a really bad name. It includes these characters: !@#$%^&*()"> you can access it using ${'This_is_a_really_bad_name___It_includes_these_characters:_!@#$%^&*()'} or $HTTP_POST(or GET)_VARS['This_is_a_really_bad_name___It_includes_these_characters:_!@#$%^&*()'] http://www.php.net/manual/variables-from-outside-php.php

« previous php.notes (#3139) next »