Page 1 of 1

Noobie Menu Question

Posted: Thu Feb 12, 2009 7:46 pm
by wulfgen
:?: I just spent about 20min searching for something related but I cant find anything close.....

I have a layout/design called index.php - on that page I have an include for the menu (include menu.php) on the left

There is a column where I have another include (home.php) with just the home text/images etc on that page -

What I'm stumped at is: where the menu calls another page EG:about.php (all it has on it is the info and the company image) can it load into the index page, where the current (home) include is, do I need to put it in a named div? Or something like that so the menu calls to the other page to replace the current content....

That way all I have to do is just generate the page without the need to constantly regenerate all the layout and graphics....

Is there an easy way to do that?

This is some of my first attempts at php - normally I do JS or html calls...

I tried adding this to the index -

Code: Select all

<?php
if (! file_exists("$index.php"))
{
include("home.php");
}
else
{
include("$index.php");
}
?>
and on the menu I used this;

Code: Select all

<a href="index.php?page=test;"><span>Test Item</span></a>
the test file is called test.php

It does'nt seem to work - is this code way off base?

Re: Noobie Menu Question

Posted: Thu Feb 12, 2009 11:10 pm
by josh
Where is $index coming from and you should also filter user input before you include on it. What if a hacker went to ?file=../../something/secret.password