Jump to content

pages


1grant1

Recommended Posts

This is a rough example, but somthing like this could work:

<?php
switch($_GET['page']){
case 2:
switch($_GET['admin']){
case "admin":
	echo 'Admin Page # '.$_GET['page'];
break;
case "user":
	echo 'User Page # '.$_GET['page'];
break;
}
break;
default:
echo 'Default Page';
break;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/36524-pages/#findComment-173904
Share on other sites

so should this work ...its on page 6

if ($page == "page1"){ 
$a =1; 
$file = 1; 
}elseif ($page == "page2"){ 
$b = 1;
$file = 2;
}elseif ($page == "page3"){
$c = 1;
$file = 3;
}elseif ($page == "page4"){
$d = 1;
$file = 4;
}elseif ($page == "page5"){
$e = 1;
$file = 5;
}elseif ($page == "page6"){
switch($_GET['admin']){
case "admin":
	echo 'Admin Page # '.$_GET['page'];
break;

$f = 1;
$file = 6;
}
}else {
$a = News;
$file = include ('news.news');
}

Link to comment
https://forums.phpfreaks.com/topic/36524-pages/#findComment-173945
Share on other sites

well I must be doing somthing wrong becasue it wont show up as anything it just brings me back to the default page

$page = $_GET['page'];
if ($page == "page1"){ 
$a = include ('news.news'); 
$file = News; 
}elseif ($page == "page2"){ 
$b = 2;
$file = include ('iframe_chat.php');
}elseif ($page == "page3"){
$c = 1;
$file = 3;
}elseif ($page == "page4"){
$d = 1;
$file = 4;
}elseif ($page == "page5"){
$e = 1;
$file = 5;
}elseif ($page == "page6"){
             switch($_GET['admin']){
case "admin":
	echo 'Admin Page # '.$_GET['page'];
break;

$f = 1;
$file = 6;
}

}else {
$a = News;
$file = include ('news.news');
}

Link to comment
https://forums.phpfreaks.com/topic/36524-pages/#findComment-174076
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.