Hi there and Good day to all,

I'm currently working a project. It's a custom made CMS for my website project. Currently i'm experiencing a hard time solving my problem since i'm a beginner. And so, help from you guys will be great smile for me :D

Anyway here's my problem, i've noticed that some CMS consider user's actions as "mode" plus the action itself (ie. http://localhost/site/index.php?mode=action). On the site i've made there's a loginpage that will redirect to a page with a Default mode named adm_editpage.php?mode=Default. there's a bunch of code i've made inside the adm_editpage.php:

1. <div class="div_main_cont_">
   2.                 <?php
   3.                 switch ($_GET["mode"]) {
   4.                     case "GoNews":
   5.                         printContentDiv_GoNews();
   6.                         break;
   7.                     case "GoActSched":
   8.                         echo $printContentDiv_GoActSched;
   9.                         break;
  10.                     case "GoSchoolStory":
  11.                         printContentDiv_GoSchoolStory();
  12.                         break;
  13.                     case "GoAlumni":
  14.                         echo $printContentDiv_GoAlumni;
  15.                         break;
  16.                     case "Default":
  17.                         printContentDiv_QuickPost();                            
  18.                         break;
  19.                 }
  20.                
  21.                 ?>
  22.                
  23.              </div>

This will return the printContentDiv_QuickPost() since the url was set to adm_editpage.php?mode=Default.

Here's the code of printContentDiv_QuickPost():

1.  
   2. if ($_REQUEST['mode'] == "Default") {
   3.  
   4.     switch ($_GET['quickmgtMode']) {
   5.         case "isAddingNews":
   6.                    print <<<HERE
   7.                     hello world you are adding news
   8. HERE;
   9.         break;
  10.  
  11.     default:
  12.  
  13.         $qlink_article = $_SERVER['PHP_SELF']."?quickmgtMode=isAddingNews";
  14.         $qlink_event = $_SERVER['PHP_SELF']."?quickmgtMode=isAddingEvent";
  15.         $qlink_usrmgt = $_SERVER['PHP_SELF']."?quickmgtMode=isUsrMgt";
  16.         print <<<HERE
  17.                <a href="$qlink_article" id="font_quick_management">News</a>
  18.                <a href="$qlink_event" id="font_quick_management">Event Schedule </a>
  19.                <a href="$qlink_usrmgt" id="font_quick_management">Quick User Management </a>
  20.                      
  21.                 hello world this is the default!
  22.  
  23. HERE;
  24.         break;
  25.     }
  26. }

t printed the div contents as it was set to Default. But the quickmgtMode=isAddingNews parameter isn't working and not printing the "hello world you are adding news"...

What are my mistakes? helps and replies will be much appreciated! thank you so much in advance!

I think this is what you are trying to do and it works fine for me when accessing it with
servername.com/test.php?mode=Default&quickmgtMode=isAddingNews:

<div class="div_main_cont_">
<?php
switch ($_GET["mode"])
{
	case "GoNews":
		printContentDiv_GoNews();
		break;
	case "GoActSched":
		echo $printContentDiv_GoActSched;
		break;
	case "GoSchoolStory":
		printContentDiv_GoSchoolStory();
		break;
	case "GoAlumni":
		echo $printContentDiv_GoAlumni;
		break;
	case "Default":
		printContentDiv_QuickPost();                            
		break;
}
?>
</div>
<?
function printContentDiv_QuickPost()
{
	if ($_REQUEST['mode'] == "Default") 
	{
		switch ($_GET['quickmgtMode']) 
		{
			case "isAddingNews":
				print <<<HERE
				hello world you are adding news
HERE;
				break;
			default:
				$qlink_article = $_SERVER['PHP_SELF']."?quickmgtMode=isAddingNews";
				$qlink_event = $_SERVER['PHP_SELF']."?quickmgtMode=isAddingEvent";
				$qlink_usrmgt = $_SERVER['PHP_SELF']."?quickmgtMode=isUsrMgt";
				print <<<HERE
				<a href="$qlink_article" id="font_quick_management">News</a>
				<a href="$qlink_event" id="font_quick_management">Event Schedule </a>
				<a href="$qlink_usrmgt" id="font_quick_management">Quick User Management </a>
				hello world this is the default!
HERE;
				break;
		}
	}
}
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.