Jump to content

what variable is set


BrainSmasher

Recommended Posts

I got this code already

if(isset($_GET['page'])){if($_GET['page'] == ""){include("menu.php");}if($_GET['page'] == "form"){include("formular.php");}else{echo "This page doesnt exists!";}}

But now my question is how to include main.php if no variable or an other variable like ?id is set

Link to comment
Share on other sites

here i made your code the way i think you want iti dont really see a reason for the isset() so i did not put it in the code

<?php//include main.php if no var is selectedif(!$_GET['page']){include('main.php');}//include other pageselseif($_GET['page'] == ""){include("menu.php");}elseif($_GET['page'] == "form"){include("formular.php");}else{echo "This page doesnt excists!";}?>

Link to comment
Share on other sites

I dont get what you are asking...If those are all the things that you are checking for, then just put include("main.php") in the else statement of your code.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...