4 Replies Latest reply on Feb 21, 2010 10:06 PM by bregent

    Problem with Display view

    addnon

      So I'm trying my hand at some PHP programming. I made a table..all looks well:

      http://slu.edu/~ahussani/site/view_correct.jpg

       

      However, once I insert my PHP tags, the display view doesn't display my content correctly (eg, my table is gone). (It looks fine at the actual URL and in Live View though)

      http://slu.edu/~ahussani/site/view.jpg

       

       

      What is the problem? It is annoying not knowing where my cells are and what not.

       

      Here is my code:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Untitled Document</title>
      <link href="style.css" rel="stylesheet" type="text/css" /></head>
      
      <body class="Background">
      <span class="Background"></span>
      <table width="1000" height="400" border="0" cellpadding="0" cellspacing="0">
        <tr>
         <td height="207" colspan="2"><?PHP include "template_topleft.php"; ?></td>
          <td width="795" height="207"><?PHP include "template_topright.php"; ?></td>
        </tr>
        <tr>
          <td colspan="2" rowspan="2"><?PHP include "template_menu.php"; ?></td>
          <td bgcolor="#333333"> </td>
        </tr>
        <tr>
          <td height="35"><?PHP include "template_body_footer.php"; ?></td>
        </tr>
        <tr>
          <td height="61" colspan="3">4</td>
        </tr>
      </table>
      </body>
      </html>
      

        • 1. Re: Problem with Display view
          Ben M Adobe Community Professional

          To be honest I don't know what to say.  The image suggests that the code has an error at the end of the </head> but I don't see anything in your code to suggest an error.  And the document appears to have been saved, which means it was updated and should display properly.  The only thing I'm not 100% sure about is "<?PHP".  I always thought that the letters had to be in lowercase to validate XHTML but I guess it makes sense that code gets ignored, so I don't think that is an issue at all.

           

          I'm wondering if there is something in the included files causing the display issue.  Do you have the code from the first page being included ( template_topleft.php )?

          1 person found this helpful
          • 2. Re: Problem with Display view
            addnon Level 1

            template_topleft.php:

             

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>Untitled Document</title>
            </head>
            
            <body>
            <img src="template/top_left.jpg" width="205" height="207" />
            </body>
            </html>
            

             

             

            also changed to div tags in the main page...no dice:

             

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>Untitled Document</title>
            <link href="style.css" rel="stylesheet" type="text/css" /></head>
            
            <body class="Background">
            <span class="Background"></span>
            <div id="header_left"><?php include "template_topleft.php"; ?></div>
            <div id="header_right"></div>
            <div id="menu"></div>
            <div id="content"></div>
            <div id="content_footer"></div>
            </body>
            </html>
            

            • 3. Re: Problem with Display view
              bregent Most Valuable Participant

              >template_topleft.php:

               

              There's your problem. Include files should only be snippets of code, not complete html pages. In particular, they should not contain doctype, html, head or body tags - otherwise you will end up with duplicate tags which is invalid html.

              • 4. Re: Problem with Display view
                addnon Level 1

                Thank you, that fixed it!!