undefined Variable error help needed

I’m new to php and starting off with a simple submit code.
I have a sumbit page with the following code

<?PHP $username = $_POST['username']; echo ($username); ?>

Username

Please type in your username and click Submit

and the code of the submitform.php is:-

Submit FORM <?PHP $username = strtolower($username); if ($username == "abc") { echo ""; } elseif ($username == "xyz") { echo ""; } else { echo ""; } ?>

On my test server all runs ok and the coding processes the $username variable but when it is put onto my live server I get Undefined variable: username … on line 9, this refers to
$username = strtolower($username);

My test server is running php 4.4.9 and the live server is running 5.2.3
I do not have direct access to the live server so I can’t change the error logging levels etc.

Please help

Sponsor our Newsletter | Privacy Policy | Terms of Service