Page 1 of 1

changing includes based on user input

Posted: Wed Jul 02, 2003 11:26 am
by polosport6699
I would like to change the configuration file to select different databases based on user input. I cannot get the variables from the previous page to show up on this page. This code below is the header, I have a form page that has checkboxes with the name db. I send the values to this script but they do not work.....any help?

Code: Select all

global $db;
if ($db=='1') {
$now='iware_config.php'; }
elseif ($db=='2') {
$now='iware_config2.php'; }
else ($db=='3') {
$now='iware_config3.php'; }
	if(isset($ModLoader) && $ModLoader==1)
		{
		include "../../admin/iware_config.php";	
		include "../../admin/gui.php";
		}
	else
		{
		if(isset($ClientLoader) && $ClientLoader==1)
			{
			include "admin/iware_config.php";	
			include "admin/gui.php";
			}
		else
			{
			include "$now";	
			include "gui.php";
			}
		}

Posted: Wed Jul 02, 2003 11:49 am
by SBukoski
Is the value $db being passed in as a GET or POST variable? Try using $_POST['db'] or $_GET['db'] depending on which method was used. If you echo out the value does it return anything?