Hello,
This is a fairly common problem. Until version 4.2.x of PHP, there was a directive called register_globals the default value of which was On. Since 4.2.0 the default value is Off. The difference is how you access variables in sessions, cookies, and forms. If register_globals is set to On, you can do just what you have been trying to do. However, this is insecure, so usually (if the admin is smart) register_globals is set to off. Then you have to have to access the variables like Blue Penguin says to. More information
here.
If you have a form with many input items, you can do this:
Code:
extract( $_POST ); //if the form has the POST method, otherwise extract( $_GET );
Then you can use the variables as you have trying to. extract() works on any array that has key names for the elements. So if you did this:
Code:
$myArray[ 'value1' ] = $something;
$myArray[ 'value2' ] = $somethingElse;
extract( $myArray );
you would then have variables $value1 and $value2.