Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
01-05-2006, 07:02 AM #1
- Join Date
- Aug 2005
- Thanked 1 Time in 1 Post
content switch inside a content switch.
I have my index.php file which is the layout for the site, and includes a section that im using a:
case 'rand': include('includes/random.inc.php'); break;
case 'submit': include('includes/submit.inc.php'); break;
case 'admin': include('admin/admin.php'); break;
case 'adminlog': include('admin/adminlogin.php'); break;
default: include('includes/new10.inc.php'); break;
Inside a part of the adminlogin.php page, i have another switch, that again i want to use the same template as index.php, and insert itself in the same place.
mysql_connect ($dbhost, $dbusername, $dbuserpass);
mysql_select_db($dbname) or die(mysql_error());
$query="SELECT * from $logtable where username='$username' and password='$password'";
$result= mysql_query($query) or die("Could not execute query: $q." . mysql_error());
if (mysql_num_rows($result) == 0)
echo "<div align=center><b>Oops! Your login is wrong. Please click back and try again.</b></div>";
if ($_SESSION['login_username'] = $username)
case 'edit': include('edittuts.php'); break;
default: include('edittuts.php'); break;
Im thinking the code i am currently using should work, but it doesn't. Any idea how to do this but make it work?
01-05-2006, 09:10 AM #2
- Join Date
- Sep 2005
- Thanked 36 Times in 35 Posts
you can't have to GET variables called 'act', call one of them something else