help in writting pages in modules
Posted: Sat Apr 10, 2010 8:29 am
hi everyone...
im fairly new to web programming and more specifically to PHP.
what im trying to achieve is try to write different parts of my page separately and then glue them together, in this way my code will be more readable and easier to maintain.
my current situation is the following...i have a page named profile.php which im redirected to after login...
in this page i have a <div> for sidebar and another <div> for contents...
the side bar is a list of <a>
inside the <div> of the content; i catch the $_GET of the sidebar links and then glue another php file based on the $_GET parameter;
inside the newly glued php file i also have <a> tags but im not being able to catch them via $_GET...
here is part of my code.
the following is part of profile.php
now as you can see that when the user press the home link in the side bar, the HomeEntrySection.php in glued...
my problem is in the HomeEntrySection.php file..
here is how HomeEntrySection.php looks like:
my problem is that i cant catch the menu from $_GET...when i press the User Management it takes me to um...what i want is to be able to catch "um" in profile.php as a $_GET parameter....
thanks in advance
im fairly new to web programming and more specifically to PHP.
what im trying to achieve is try to write different parts of my page separately and then glue them together, in this way my code will be more readable and easier to maintain.
my current situation is the following...i have a page named profile.php which im redirected to after login...
in this page i have a <div> for sidebar and another <div> for contents...
the side bar is a list of <a>
inside the <div> of the content; i catch the $_GET of the sidebar links and then glue another php file based on the $_GET parameter;
inside the newly glued php file i also have <a> tags but im not being able to catch them via $_GET...
here is part of my code.
the following is part of profile.php
Code: Select all
<div id="content">
<?php
if(isset ($_SESSION['userObject'])) {
$userObject = unserialize($_SESSION['userObject']);
if($userObject instanceof User) {
if(isset ($_GET['action'])) {
if($_GET['action'] == 'home') {
require 'Objects/Service_Providers/Page_Parts/Control_Panel_Pages/HomeEntrySection.php';
}?>
</div>
<div id="sidebar">
<ul>
<li>
<ul>
<li><a href="profile.php?action=home">Home</a></li>
</ul>
</li>
</ul>
</div>
my problem is in the HomeEntrySection.php file..
here is how HomeEntrySection.php looks like:
Code: Select all
<?php
session_start();
if(isset ($_SESSION['userObject'])) {
$userObject = unserialize($_SESSION['userObject']);
if($userObject instanceof User) {
if($userObject->isAdminUser()) {
?>
<h2 class="title">Administrator's Section</h2>
<div style="clear: both;"> </div>
<div id="menu">
<ul>
<li><a class="current_page_item" href="menu=um">User Management</a></li>
</ul>
</div>
thanks in advance