Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. PHP Include problem

PHP Include problem

Scheduled Pinned Locked Moved Web Development
phphtmldatabasecomhelp
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dhewitt88
    wrote on last edited by
    #1

    Hey everyone, this is my first post, been trying to find a solution to this problem for couple days now, but no luck so far. I got this to work on a site I worked on a long time ago, but have since forgot how I did it unfortanetly. My problem is I have a top_inc.php which holds the header menu as well as the left side content. The problem is when I include this into my index.php, it causes anything I enter into the html on this page to be pushed below the side left content which is in the top_inc.php. I'm new in this industry and any suggestions are greatly appreciated. Thanks in advance. http://www.hewittmediasolutions.com/sn/index.php for referance.

    M 1 Reply Last reply
    0
    • D dhewitt88

      Hey everyone, this is my first post, been trying to find a solution to this problem for couple days now, but no luck so far. I got this to work on a site I worked on a long time ago, but have since forgot how I did it unfortanetly. My problem is I have a top_inc.php which holds the header menu as well as the left side content. The problem is when I include this into my index.php, it causes anything I enter into the html on this page to be pushed below the side left content which is in the top_inc.php. I'm new in this industry and any suggestions are greatly appreciated. Thanks in advance. http://www.hewittmediasolutions.com/sn/index.php for referance.

      M Offline
      M Offline
      Mohammad Dayyan
      wrote on last edited by
      #2

      Hi dhewitt88 and welcome to CP. I don't understand your meaning well, can you post your snippet code .

      D 1 Reply Last reply
      0
      • M Mohammad Dayyan

        Hi dhewitt88 and welcome to CP. I don't understand your meaning well, can you post your snippet code .

        D Offline
        D Offline
        dhewitt88
        wrote on last edited by
        #3

        this is the index.php, I typed in hello just for testing ------------------------- Welcome to Stork News!

        hello

        ------------------------- this is the top_inc.php that is for the php include (i took out the mapping to reduce the code length): -------------------------

        M 1 Reply Last reply
        0
        • D dhewitt88

          this is the index.php, I typed in hello just for testing ------------------------- Welcome to Stork News!

          hello

          ------------------------- this is the top_inc.php that is for the php include (i took out the mapping to reduce the code length): -------------------------

          M Offline
          M Offline
          Mohammad Dayyan
          wrote on last edited by
          #4

          You should write something like this : Index.php

          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <title>Welcome to Stork News!</title>
          <?php
          include ("top_inc.php" ) ;
          ?>
          </head>
          <body>
          <table align="right" width="841">
          <tr>
          <td>hello</td>
          </tr>
          </table>
          </body>
          </html>

          top_inc.php

          <table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
          <td align="center"><img src="images/header_banner.gif" width="1024" height="159" border="0" usemap="#Map" />
          </tr>
          <tr>
          <td><img src="images/babiesrus.gif" width="182" height="123" border="0" usemap="#Map2" />
          </tr>
          </td>
          <tr>
          <td><img src="images/left_2.gif" width="182" height="122" />
          </tr>
          </td>
          <tr>
          <td><img src="images/left_3.gif" width="182" height="123" />
          </tr>
          </td>
          <tr>
          <td><img src="images/left_4.gif" width="182" height="122" />
          </tr>
          </td>
          <tr>
          <td><img src="images/left_bottom.gif" width="182" height="123" />
          </tr>
          </td>
          </table>

          D 1 Reply Last reply
          0
          • M Mohammad Dayyan

            You should write something like this : Index.php

            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>Welcome to Stork News!</title>
            <?php
            include ("top_inc.php" ) ;
            ?>
            </head>
            <body>
            <table align="right" width="841">
            <tr>
            <td>hello</td>
            </tr>
            </table>
            </body>
            </html>

            top_inc.php

            <table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
            <td align="center"><img src="images/header_banner.gif" width="1024" height="159" border="0" usemap="#Map" />
            </tr>
            <tr>
            <td><img src="images/babiesrus.gif" width="182" height="123" border="0" usemap="#Map2" />
            </tr>
            </td>
            <tr>
            <td><img src="images/left_2.gif" width="182" height="122" />
            </tr>
            </td>
            <tr>
            <td><img src="images/left_3.gif" width="182" height="123" />
            </tr>
            </td>
            <tr>
            <td><img src="images/left_4.gif" width="182" height="122" />
            </tr>
            </td>
            <tr>
            <td><img src="images/left_bottom.gif" width="182" height="123" />
            </tr>
            </td>
            </table>

            D Offline
            D Offline
            dhewitt88
            wrote on last edited by
            #5

            I changed the files accordingly and uploaded them to the server. I'm still having the problem where the html from the index.php

            hello

            is showing up below the include file. you can see the problem at http://www.hewittmediasolutions.com/sn/index.php thanks for the help btw

            M 1 Reply Last reply
            0
            • D dhewitt88

              I changed the files accordingly and uploaded them to the server. I'm still having the problem where the html from the index.php

              hello

              is showing up below the include file. you can see the problem at http://www.hewittmediasolutions.com/sn/index.php thanks for the help btw

              M Offline
              M Offline
              Mohammad Dayyan
              wrote on last edited by
              #6

              I couldn't see your web page. it doesn't show ( why ? ) try this :

              <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
              <title>Welcome to Stork News!</title>
              </head>
              <body>
              <?php include ("top_inc.php" ); ?>
              <table align="right" width="841">
              <tr>
              <td>hello</td>
              </tr>
              </table>
              </body>
              </html>

              D 1 Reply Last reply
              0
              • M Mohammad Dayyan

                I couldn't see your web page. it doesn't show ( why ? ) try this :

                <html xmlns="http://www.w3.org/1999/xhtml">
                <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <title>Welcome to Stork News!</title>
                </head>
                <body>
                <?php include ("top_inc.php" ); ?>
                <table align="right" width="841">
                <tr>
                <td>hello</td>
                </tr>
                </table>
                </body>
                </html>

                D Offline
                D Offline
                dhewitt88
                wrote on last edited by
                #7

                hmm, tried that and it didn't work :(, wonder why the page won't show up for you, maybe I linked it incorrectly. http://www.hewittmediasolutions.com/sn/index.php[^] that should work

                S 1 Reply Last reply
                0
                • D dhewitt88

                  hmm, tried that and it didn't work :(, wonder why the page won't show up for you, maybe I linked it incorrectly. http://www.hewittmediasolutions.com/sn/index.php[^] that should work

                  S Offline
                  S Offline
                  sph3rex
                  wrote on last edited by
                  #8

                  Atm you have 2 tables ... one with a width of 1024 and right after a table with 100% width ... so you need to do something like this: <table width="1024" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" colspan="2"><img src="images/header_banner.gif" width="1024" height="159" border="0" /> </td> </tr> <tr> <td width="182"><img src="images/babiesrus.gif" width="182" height="123" border="0" /> <td rowspan="5"><?php include("that_header_file");?></td> </tr> </td> <tr><td><img src="images/left_2.gif" width="182" height="122" /> </tr> </td> <tr><td><img src="images/left_3.gif" width="182" height="123" /> </tr> </td> <tr><td><img src="images/left_4.gif" width="182" height="122" /> </tr> </td> <tr><td><img src="images/left_bottom.gif" width="182" height="123" /> </tr> </td> </table> </body> </html>

                  modified on Saturday, November 8, 2008 9:35 PM

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups