Need help making a menu

Discussion in 'Programming' started by Nickower, May 23, 2007.

  1. #1
    Hi,
    Id like to make a menu where i can just update one page and it does it site wide, like an iframe type thing.. But i tryed that and whenever people clicked it just opened up the link inside an iframe. Are there any other tactics? if so whats the code to do it?
    Thanks alot if you can help:),
    Nick
     
    Nickower, May 23, 2007 IP
  2. sm9ai

    sm9ai Active Member

    Messages:
    746
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    60
    #2
    What language are you using?

    But basically you want to use an include of some description.
     
    sm9ai, May 23, 2007 IP
  3. Nickower

    Nickower Banned

    Messages:
    437
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, well the site is built in HTML. So i was thinking maybe ASP? or PHP? or Java? but i just dont know how to make one or a link to guide to learn.
     
    Nickower, May 23, 2007 IP
  4. sm9ai

    sm9ai Active Member

    Messages:
    746
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    60
    #4
    sm9ai, May 23, 2007 IP
    Nickower likes this.
  5. Nickower

    Nickower Banned

    Messages:
    437
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ahhhh ok.. So i can make a HTML page, but call it *.php
    and use that php code to link to it, so id have my page set up something like this
    <?php
    include "pathto/navigationpage.php";
    ?>
    <?php
    include "pathto/mainpage.php";
    ?>
    <?php
    include "pathto/footer.php";
    ?>
     
    Nickower, May 23, 2007 IP
  6. rennick

    rennick Peon

    Messages:
    85
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can also leave the page named .html and add a line to your .htaccess file to process the .html as php, which can be helpful if the page already exists and is indexed.

    AddType application/x-httpd-php .html
    Code (markup):
    will generally do it.
     
    rennick, May 23, 2007 IP
  7. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #7
    How much 'content' do you have?

    Is there any reason you don't want to 'port' it to a proper CMS (eg. Joomla)? That would take care of it all for you and then some.
     
    TwistMyArm, May 23, 2007 IP
  8. Nickower

    Nickower Banned

    Messages:
    437
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    The person who im making the website for doesnt want a CMS.. thats the first thing i suggested as it would make things x100 more easier, but they need support pages, and other stuff so CMS isnt right for them really, This is a commercial website for a print management solutions company.
    EDIT: one quick quesiton, how do i control the heghts and widths of the pages displayed?
     
    Nickower, May 23, 2007 IP
  9. Nickower

    Nickower Banned

    Messages:
    437
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Still need help, and i made a page like this..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    <?php
    include "pathto/header.php";
    ?>
    <?php
    include "pathto/home.php";
    ?>
    <?php
    include "pathto/footer.php";
    ?>
    <body>
    </body>
    </html>


    But that didnt work..
     
    Nickower, May 23, 2007 IP
  10. rennick

    rennick Peon

    Messages:
    85
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #10
    You have to put the php includes where you want the actual content of the include to show up, as in inside the <body> tags.
     
    rennick, May 23, 2007 IP
  11. Nickower

    Nickower Banned

    Messages:
    437
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Like this?

    <?php include("header.php"); ?>
    <?php include("home.php"); ?>
    <?php include("footer.php"); ?>
     
    Nickower, May 23, 2007 IP
  12. craig9001

    craig9001 Peon

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12

    Cool trick, cheers man didn't know about this command.
     
    craig9001, May 24, 2007 IP
  13. rennick

    rennick Peon

    Messages:
    85
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #13
    No, I mean this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    
    <?php include "pathto/header.php"; ?>
    <?php include "pathto/home.php"; ?>
    <?php include "pathto/footer.php"; ?>
    
    </body>
    </html>
    
    Code (markup):
    Remember the includes are going to build your normal html page. A regular page has the header, content and footer within the body tags, so that's where you put the includes. (I don't usually wrap the include code on multiple lines, if I don't have to.)
     
    rennick, May 24, 2007 IP
  14. rennick

    rennick Peon

    Messages:
    85
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #14
    No problem. I ran into it a long time ago when I had a HUGE site that was all .html pages, but I wanted to convert it to using includes. The idea of changing the pages to .php and adding all those redirects to the .htaccess made my brain throb.
     
    rennick, May 24, 2007 IP