-
header controled Frame
Is it possible to create a dynamic type of page that will change the URL address when the frame content is changed, like index.php?main=updates.html
this way I could include my framed menu without the lack of linking capabilities. Any ideas?
To clarify the index page would be a dynamic page with frames. When you click a link instead of leaving the URL address alone, it changes to index.php?main=content/link.html
This way you can have a framed menu and better linking capabilites.
-
You mean something like:
Code:
<frameset><frame src="nav.php">
<frame src="<?php echo $_GET['main']; ?>"></frameset>
Sure is possible. Just make sure nobody can insert their own pages into your frameset.
-
how do I set the default page if there is no value? I'm using cells now
Code:
<td nowrap><?php include $_GET['load']; ?></td>
-
I do this on my site. It also stops people injecting their own vlaues too:
PHP Code:
<?php
$location = (isset ($_GET['location'])?$_GET['location']:'main');
switch ($location) {
case 'random':
$includefile = 'random.php';
break;
case 'projects':
$includefile = 'projects.php';
break;
case 'main':
default:
$includefile = 'main.php';
}
@include ("include/$includefile");
?>
-
doesn't seem to work, I don't need to prevent injecting own values or any thing complex, just an include page and a default start page. How do I apply the code you gave?
-
umm... you put it in the page?
Can you explain what it is that isn't working? Are you getting an error... is it loading the wrong page... ???
-
Code:
<frameset><frame src="nav.php">
<frame src="<?php echo $_GET['main']; ?>"></frameset>
I need to do the exact same thing but in .asp now, other code is already .asp