PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
if ($nav=="login") {
include "login_include.php";
} elseif ($nav=="register") {
include "login_register.php";
} elseif ($nav=="") {
echo "Main Page";
}
?>
Then going to http://www.myaddress.com/main.php?nav=login would give me just the contents of login_include.php or going to http://www.myaddress.com/main.php would just echo "Main Page." For some reason, on a fresh PHP installation of a new Win2K server running IIS, I cannot do this. For whatever $nav is, I always get "Main Page" no matter what and there are no error messages. Anyone have any idea why this might be? Is there something in PHP.ini I need to fix or is there something I'm doing wrong in code in a new version of PHP? Thanks in advance for the help!
Sounds like your old version of php still had global variables turned on. In newer version it is turned off by default, you can either turn it back on in your php.ini file, or address your variables according to where they come from, I.E. $_GET[nav]