Log in

View Full Version : Display different content in existing page



shanesmith71
01-26-2009, 02:17 AM
Hello;

I have been looking for a way to display new content into an existing page. I would like to have my home page with the header footer & menu remain. I would then like to have the requested content displayed on this page when I click on the menu item.

If this is possible can some one please give me a sample to look at.

Thank You

Nile
01-26-2009, 02:21 AM
I assume your using php:
header.php

<html>
<head>
<title>Page | <?php echo $_SERVER['PHP_SELF']; ?></title>
</head>
<body>
index.php


<?php
include('header.php');
?>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sed leo ac ipsum facilisis rutrum. Integer ultricies. Phasellus vitae orci. Morbi vitae dolor sed est eleifend porttitor. Nullam imperdiet. Suspendisse vitae ante id ligula interdum dignissim. Praesent porta. Nullam sodales elit. Quisque a mi id erat pellentesque dignissim. Proin nunc. Phasellus lacus metus, iaculis at, molestie non, ultricies eget, enim. Phasellus suscipit libero eget nunc. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
</p>
<?php
include('footer.php');
?>

footer.php


<div id="footer" style="width: 100%;background-color: blue; font-family: arial;color: #FFF;text-align: center;">Some Rights Reserved &copy; <?php echo "2000-".date('Y'); ?></div>
</body>
</html>

shanesmith71
01-26-2009, 11:32 PM
I am not using anything except HTML as of yet, with examples I am usually able to fiddle through most problems. I have read more about javascript but I am having a problem getting it to work.

Thanks

Nile
01-28-2009, 04:12 AM
Sorry, the only other way I can think of is frames - and thats not the best idea. Do you know if your host comes with PHP? You really don't need knowledge of PHP, all you have to do is have that code, and on each page do:


<?php
include('header.php');
?>
<p>This is the about page with the same header.
<?php
include('footer.php');
?>

Depending on how your style works - if that will not work for you I guess the only thing I can say is use ajax...?