Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    135
    Thanks
    29
    Thanked 1 Time in 1 Post

    problem inserting external php file

    Hey guys,

    I finally figured out how to create my layout in a nicely organized way and everything seems to work fine except that for the header part, I want to include the file "header.php" so I could modify the header.php instead of the index.php, however im having a hard time getting things to look the way i want to. when I add the file, it pushes the entire layout to the left instead of staying centered.

    this is the code i put in the index file:

    PHP Code:
    <?php include("header.php"); ?>

    here you can see how it looks like:
    http://derderder.cwsurf.de/

    any help appreciated!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    <div id="header">
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Unbenanntes Dokument</title>

    <style>
    #top-wrap { width: 960px; height; 149px; align: center; }
    #header { width: 960px; height; 85px; align: center; }
    #nav { width: 960px; height; 69px; align: center; }


    </style>
    </head>
    You shouldn't make your individual files with complete html structure. The structure is required only for the final page source after parsing all php code
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    135
    Thanks
    29
    Thanked 1 Time in 1 Post
    I'm not sure what you mean. Could you elaborate please?

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Take a look at your generated html source code taken from browser's "view source" option.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    135
    Thanks
    29
    Thanked 1 Time in 1 Post
    Quote Originally Posted by abduraooft View Post
    Take a look at your generated html source code taken from browser's "view source" option.
    hey i just realized that i used the wrong file to for the header.php and mixed up codes. that's why I was confused. i was doing too many things at a time and didn't realize that I what I was doing was complete nonsense. thanks


  •  

    Posting Permissions

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