Trying to use a concatenated constant in $_POST
Posted: Mon May 07, 2007 4:27 pm
I get an undefined index in this example:
Lets say that I do a print_r($_POST) and I verify that $_POST has some value:
Here is the implementation:
I have tried doing things such as trimming the $input variables and stripping single and double quotes, but still nothing...
I should note that if I set up $input to be "testExample", all works fine, but since this is not using the constant properly I can't do it this way.
Thanks!
Lets say that I do a print_r($_POST) and I verify that $_POST has some value:
Code: Select all
Array
(
[testExample] => thisIsAnExample
)Code: Select all
define('XYZ_TEST', 'testExample');
function One()
{
functionTwo("XYZ");
}
function Twp($prefix)
{
$input = $prefix . '_TEST';
echo 'Post variable=' . $_POST[$input] . ' gives an undefined index';
}I should note that if I set up $input to be "testExample", all works fine, but since this is not using the constant properly I can't do it this way.
Thanks!