Results 1 to 4 of 4

Thread: Display different content in existing page

  1. #1
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Display different content in existing page

    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

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I assume your using php:
    header.php
    Code:
    <html>
    <head>
    <title>Page | <?php echo $_SERVER['PHP_SELF']; ?></title>
    </head>
    <body>
    index.php
    Code:
    <?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
    Code:
    <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>
    Jeremy | jfein.net

  3. #3
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    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:
    Code:
    <?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...?
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •