+ Reply to Thread
Results 1 to 6 of 6

Thread: PHP And HTML Div Tags

  1. #1
    masterjake is offline x10Hosting Member masterjake is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    73

    Unhappy PHP And HTML Div Tags

    I'm having some real problems. Every time I do any PHP like including files inside a div tag e.g.

    Code:
    <div class="some****">
    <?php
    include("include/navigation.php");
    ?>
    </div>
    it always screws up the page and stops the html from rendering. I guess I'm going to have to go through and redo the layout using tables instead of divs. Anyone know why this happens though?

  2. #2
    driveflexfuel is offline x10 Sophmore driveflexfuel is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    159

    Re: PHP And HTML Div Tags

    Why are you placing the include inside the div. I usually just place the div inside the include.

  3. #3
    masterjake is offline x10Hosting Member masterjake is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    73

    Re: PHP And HTML Div Tags

    Because It's how the layout was made, but I'm going to remake it using table's for simplicity. I'll get the same result but no php errors.

  4. #4
    scopey is offline x10Hosting Member scopey is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    62

    Re: PHP And HTML Div Tags

    Check for overlapping tags etc. I'm guessing that the included file has one too many </div> tags.
    - When in doubt, refer to the PHP manual.

  5. #5
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: PHP And HTML Div Tags

    check that the navigation.php doesen't got any <html> tgas like the closing tag of html or body, or the starting, like:

    <html>, <head>, <body>

    unless you want the HTML to start/stop there

  6. #6
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: PHP And HTML Div Tags

    try changing your include syntax.

    PHP Code:

    include ("blah.php");

    //to

    include "blah.php"
    see if this works. if not try require.

+ Reply to Thread

Similar Threads

  1. Corriendo una funcion de php en file html
    By oregonsv in forum Ayuda Web
    Replies: 11
    Last Post: 10-28-2008, 01:19 PM
  2. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  3. Sigo con problemas con phpbb2
    By reciecho in forum Soporte
    Replies: 7
    Last Post: 10-20-2007, 06:28 PM
  4. Including PHP script in HTML
    By chrisv in forum Free Hosting
    Replies: 7
    Last Post: 08-31-2007, 08:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers