Results 1 to 6 of 6

Thread: Problem php AND html

  1. #1
    Join Date
    Nov 2008
    Posts
    996

    Problem php AND html

    Here is my problem

    I have at the moment thanks to the following script placed in my "base.php" managed to have a fixed menu (with footer in header) and only the page that moves; what I want is to have the same thing with menus that I put in my different pages ...

    As you can see my main pages are "p.html" there is not that the text of php. I have over my "base.css" who now manages the design of the entire site. That is what I request is possible? Am I crazy to want to do this? Any reorganization should I? can you brief me

    HTML Code:
    <!-- The header -->
    <div id="in_header">
    </div>
    <!-- The menus -->
    <div>
    <ul id="menu_horizontal">
    <li><a href="./design.php?p=home">Home</a></li>
    <li><a href="./design.php?p=fruits">Our seasonal fruit</a></li>
    <li><a href="./design.php?p=sweets">Our Sweets</a></li>
    <li><a href="./design.php?p=contact">Contact</a></li>
    </ul>
    </div>
    <div>
    <!-- The body -->
    <div id="body">
    <?php
    if(isset($_GET['p'])){
    $p=strtolower($_GET['p']);}
    if(isset($p) && preg_match("/^[a-z0-9]+$/i",$p)){
    $p=$_GET['p'];
    if(file_exists("pages/$p.html" )){
    include "pages/$p.html";
    }
    else{
    include "pages/404.html";
    }
    }
    else{
    include "pages/404.html";
    }
    ?>
    </div>
    <!-- Footer page -->
    <div id="Footer_page">
    <p>Copyright "Any rotten Corporation" 2005, All rights reserved</p>
    </div>
    </body>
    </html>

  2. #2
    Join Date
    May 2008
    Posts
    945

    Re: Problem php AND html

    You want different menus on each page, right?

  3. #3
    Join Date
    Nov 2008
    Posts
    996

    Re: Problem php AND html

    of "menus"

    example I have 4 main sports page of the ball, auto, water sports athletics. I will make sub-menu with football-rugby-hand volley f1-rally etc.

  4. #4
    Join Date
    May 2008
    Posts
    945

    Re: Problem php AND html

    You can do it in php with a function that will call the appropriate menu.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Problem php AND html

    and so if we want to go to Rugby must first go to sport? the average age is your idea. Menu and sub menu accessible from the beginning it's not user-friendly?

  6. #6
    Join Date
    May 2008
    Posts
    2,012

    Re: Problem php AND html

    Well, you can use an include for the sub-menu and another for the content. One may be contained in the page of another, it depends on the structure of your site. If you understand the script you posted below, I think you have the necessary level in PHP.

Similar Threads

  1. Urgently Needing Answer Html Problem Please Help
    By dillon78 in forum Software Development
    Replies: 1
    Last Post: 10-04-2012, 11:49 AM
  2. Problem viewing Jpeg file in html
    By Galeny in forum Software Development
    Replies: 5
    Last Post: 06-02-2010, 01:42 AM
  3. Problem Loading Flash in HTML
    By Kusagra in forum Software Development
    Replies: 4
    Last Post: 25-03-2009, 10:42 AM
  4. Html link code problem
    By ByteCoder in forum Software Development
    Replies: 4
    Last Post: 09-02-2009, 06:49 PM
  5. HTML/CSS Percentage problem
    By Soft Pack in forum Software Development
    Replies: 3
    Last Post: 05-01-2009, 11:00 PM

Tags for this Thread

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
  •  
Page generated in 1,713,258,173.78409 seconds with 17 queries