Log in

View Full Version : Sub Pages



Sani
10-28-2007, 01:16 PM
In order to avoid creating many custom pages, and then link one to another, would like to have sub pages in a page.
Im using php-fusion ,and want to insert something like "tabs" in a custom page, so that when you click on a link that it opens a content beneath and not that it redirects to another page...

Have found ayax tabs content but dunno is it possible to integrate them, has any1 a better suggestion?

djr33
10-28-2007, 01:25 PM
Ajax is an option, as are frames.
Best option is probably just using PHP and includes, based on the URL ("get" variables, like ?page=4) to display content on the page.

Sani
10-28-2007, 01:45 PM
Well tryed frames found here:
http://www.dynamicdrive.com/style/layouts/item/css-top-frame-layout/
A upper static, but when opened it goes over the whole window so...

But have managed to integrate the ayax tabs:
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

I have found such a php code but could not make it happen:

<?php
//check of the page's mode (attribute) is set so we can define it for when its needed
//we define the name of our KEY inside the $_GET array
//and we will name it "mode" for this exercise
//$_GET tells the PHP script to check the URL instead of a forms post action
if (isset($_GET['mode'])){
//define and multi-layer apply multi-layer sanitization to the mode variable
$mode = strip_tags(stripslashes($_GET['mode']));
//define the possible mode "about", url now looks like "?mode=about"
if ($mode == "about"){
//HTML that displays when "?mode=about" is requested by the browser
echo "Welcome to my about page.<br />\n";
//define the possible mode "contact", url now looks like "?mode=contact"
} elseif ($mode == "contact"){
//HTML that displays when "?mode=contact" is requested by the browser
echo "Welcome to my contact page.<br />\n";
//define the possible mode "other", url now looks like "?mode=other"
} elseif ($mode == "other"){
//HTML that displays when "?mode=other" is requested by the browser
echo "Welcome to my other page.<br />\n";
}
} else {
//since the $mode variable is not set as described above, we perform the default action:
//page.php default message when no mode is set
echo "When you access page.php directly with no URL attributes you will be given this message by your web browser.<br />\n";
echo "The mode variable is not currently set by your PHP script.<br />\n";
}
//display some HTML that is shown below everything no matter if a mode is set or not
echo "This bit of HTML is shown below all the pages: both the default page and all modes. <br />\n";
?>

But dont know how to "activate" it :
//since the $mode variable is not set as described above, we perform the default action:
//page.php default message when no mode is set

Lol