Frames Alternative

Soldato
Joined
31 Mar 2006
Posts
3,272
Location
Gravesend, Kent
Hey everyone!

I am making a new frontpage for my server when it comes back online tonight :)
However, I have made this as a design:
http://blighter.mine.nu/newserver/http/BlueDesign/
(sorry for slow speeds, i'm hosting locally at the moment!)

Now i wanted to turn the main content section into a frame type object so i dont have to go through every page and edit the links at the top when i change my mind about them. Is there any way to do this thats upto Web 2.0 standard?

Thanks

EDIT: also, whats the easiest way to make the search box search a couple of pages and display results? :)
 
Last edited:
Yea, i have XAMPP installed and all set up :) thanks i have searched on google, but does it support mutliple pages and does it support images etC? :confused:
 
Yes yes, you'll need a little script maybe something like this.

Code:
<?

include 'menu.php';

$path = $_GET['path'];
 
$page = $_GET['p'];

if (!$page) {
$page = "pages/foo.php";
}

else {
$page = "pages/".$path.$page;
}

$error = "<h1>Oh noes, </h1><h2>We seem to have lost this page!</h2>";

if (file_exists($page)) {
include ($page);
}

else {
echo $error;
}

		?>

Store the files you want to call in folder called pages.

EG:

index.php
menu.php
pages/foo.php

Then use <ahref="index.php?p=foo.php">foo</a> to call them.

Hope that helps.
 
Last edited:
SherberT* said:
Yes yes, you'll need a little script maybe something like this.

Code:
snip

Store the files you want to call in folder called pages.

EG:

index.php
menu.php
pages/foo.php

Then use <ahref="index.php?p=foo.php">foo</a> to call them.

Hope that helps.
i now understand it abit more, just PHP really confuses me for some reason :( if i post the index.html as a text file would someone be able to roughly put it in for me, and i'll fine tweak it or something?

thanks so far sherbert :)
 
SherberT* said:
Yes yes, you'll need a little script maybe something like this.

[snip]

Store the files you want to call in folder called pages.

EG:

index.php
menu.php
pages/foo.php

Then use <ahref="index.php?p=foo.php">foo</a> to call them.

Hope that helps.
Not meaning to be mean to Sherbert, but please don't use that; it's a rather large security hole :p

Instead, have header and footer files, for example, includes/header.html and includes/footer.html, and include these instead:
Code:
<?php include 'includes/header.html'; ?>
Put the page content here.
<?php include 'includes/footer.html'; ?>
 
Inquisitor said:
Not meaning to be mean to Sherbert, but please don't use that; it's a rather large security hole :p

Instead, have header and footer files, for example, includes/header.html and includes/footer.html, and include these instead:
Code:
<?php include 'includes/header.html'; ?>
Put the page content here.
<?php include 'includes/footer.html'; ?>

What's the security hole? the fact that he says to <a href= it?
 
Harib0 said:
What's the security hole? the fact that he says to <a href= it?

At a glance, an obvious one would be:

If you're at blightersserver.com/index.php?p=foo.php

you can change it to blightersserver.com/index.php?p=../index.php

Which is going to eat all up the CPU. Dunno about including external files though.
 
i read that theres a way that you can only let the ?p=..... be bit in a different directory?

e.g. if you send a request to blighter.net/?p=index.php it will actually load blighter.net/includes/index.php... is this right?

thanks for all the help so far
 
Back
Top Bottom