sofaman Posted October 23, 2006 Share Posted October 23, 2006 I'm new to php, I'm learning from a book at the minute.I'm running:apache web server 2.0.59PHP 5.0.2Mysql 5.0.24 (as a module not cgi)The same versions as what the book uses.I've installed a forum - no problemsI've created a database useing the cmd lineI can view the database in IEWhen I try to 'insert' into the database via IE I get the following with code:if ($_post) { // create empty error variable $msg = "";I receive undefined variable _postso I tried :<? $browser = $_server['php_shelf'];echo "the sniffer says: $browser" ;?>I get undefined variable _serverI've search here and php.net, I've looked through php.ini but not found anything I think might workPlease helpcheerssofa Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted October 23, 2006 Share Posted October 23, 2006 you have to use upper case with those matey!!!and PHP_SELF (not php_shelf) not seen shelf anywhere ;)try this..[code]<?phpif ($_POST) { // create empty error variable $msg = "";I receive undefined variable _postso I tried :<? $browser = $_SERVER['PHP_SELF'];echo "the sniffer says: $browser" ;?>[/code]NOTE: try not use short tags '<?' use '<?php' instead - and turn off teh short tags in your php.ini file otherwise any xml files will reek havoc!ALSO $_SERVER['PHP_SELF'] returns the name of name of the current script NOT the browser (or user agent) check the manula for the super globals info.... Quote Link to comment Share on other sites More sharing options...
sofaman Posted October 23, 2006 Author Share Posted October 23, 2006 Thank you so much they work a treat :DI've never programmed where I NEEDED to use uppercase. I must of missed the part in the book :(I think I will do the tutorials from this site next.Thanks again :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.