SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: I need a help

  1. #1
    SitePoint Member fatablue's Avatar
    Join Date
    Feb 2007
    Location
    Rome, Italy
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I need a help

    I do not know a lot about php. But I'm quite sure I need it if I want to solve my problem.

    The question is: is there a way to make a single menu that I can use on any html page, so I only need to link the menu page to the other pages?

    Hope my english is "english enough" I've lost my fluency

    Thank you very much!

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sure:
    Menu.php:
    PHP Code:
    <ul class="Menu">
        <
    li><a href="/" title="Home page">Home</a></li>
        <
    li><a href="/etc" title="Et Cetera">Etc</a></li>
    </
    ul
    And, where you want to put the menu in the files:
    PHP Code:
    <?php include 'menu.php'?>
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Member fatablue's Avatar
    Join Date
    Feb 2007
    Location
    Rome, Italy
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it so easy? :-O

    thank you very much... than if I want to customize it I can do it with CSS as usually, just linking the CSS page on menu.php, right?

  4. #4
    SitePoint Member fatablue's Avatar
    Join Date
    Feb 2007
    Location
    Rome, Italy
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why doesn't it work!!!

    I created the menu.php page and I linked it inside the div where I want it to get shown.

    but it doesn't want to appear!

  5. #5
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Look in the output HTML code in the files, what does it show you?

    If you see the PHP code there, PHP isn't being parsed. If it's a server with PHP enabled and you are using a .html file, either change the file extention to .php file or create a .htaccess file with the following line:
    Code:
    AddType application/x-httpd-php .html .htm
    To allow PHP parsing in .HTML files.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona


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
  •