#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    5
    Rep Power
    0

    Help - Ghost in the machine


    Alright, here's the deal:

    i wrote a couple of scripts and have them output HTML.

    but it's ALSO outputting HTML that I DO NOT tell it to do.
    i can't find the problem.

    First the main .php :

    Code:
    <?php
    include 'CheckLogin.php';
    
    ?>
    
    <html>
    	<head>
    		<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
    		<title>GetMiPi - Register</title>
    
    	</head>
    
    
    
    <?php
    
    include 'topmenu.php';
    
    include 'startpielist.php';
    
    //Connecting to your database
    $Con = mysql_connect($hostnameCon, $usernameCon, $passwordCon);
    mysql_select_db($dbnameCon); 
    	$sql = mysql_query("SELECT * FROM PIES WHERE Owner = '$username'") or die(mysql_error());
    	while ($query_row = mysql_fetch_array($sql))
    	{
    		$pieID = $query_row['ID'];
    		$pieOwner = $query_row['Owner'];
    		$pieKind = $query_row['Kind'];
    		$pieBaked = $query_row['Baked'];
    		$pieCHEK  = $query_row['CHEK'];
    		include 'PieList.php';
    
    	}
    ?>
    The "topmenu.php" :
    Code:
    <?php
    
    ?>
    
    <body
     style="color: rgb(0, 0, 0); background-color: rgb(148, 164, 68);"
     alink="#006600" link="#6666cc" vlink="#3366ff">
    <big><big><big></big></big></big>
    <div style="text-align: center;">
    <table
     style="text-align: center; margin-left: auto; margin-right: auto; background-color: rgb(255, 255, 204); width: 100%; height: 49px;"
     border="4" cellpadding="2" cellspacing="2">
      <tbody>
        <tr>
          <td
     style="background-color: rgb(255, 255, 204); text-align: center; vertical-align: top;"><big><big><big><span
     style="font-weight: bold;"><a
     href="http://www.getmipi.com/FAQ.html">FAQ</a>
    &nbsp; &nbsp; <a href="http://getmipi.com/forums/">FORUMS</a>
    &nbsp; &nbsp; <a href="http://getmipi.com/Contact.html">CONTACT</a>
    &nbsp; &nbsp; <a href="http://getmipi.com/Media/Media.html">MEDIA</a></span></big></big></big><br>
          </td>
        </tr>
      </tbody>
    </table>
    </div>
    next: "StartPieList.PHP"

    Code:
    <?php
    // start pie table
    ?>
    <------- start of pie list header ------>
    <table style="width: 800px; height: 560px; text-align: left; margin-left: auto; margin-right: auto;" border="4" 
    
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="vertical-align: top; text-align: center; background-color: rgb(153, 153, 255);">
    <div style="text-align: left;">
    <br>
    <table style="background-color: rgb(255, 255, 204); width: 700px; height: 131px; text-align: left; margin-left: auto; 
    
    margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="width: 50px; text-align: left; vertical-align: middle;">
    </td>
    <--- End of pie list header  ---->
    <?php
    
    // end start of pie table
    and now: "PieList.php"

    Code:
    <?php
    
    ?>
    
    <--- Start Pie List --->
    <table style="background-color: rgb(255, 255, 204); width: 700px; height: 131px; text-align: left; margin-left: auto; 
    
    margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="width: 50px; text-align: left; vertical-align: middle;">
    <img style="width: 79px; height: 45px;" alt="" src="
    
    <x=$pieimgx>
    
    " hspace="10" align="middle"> </td>
    <td>
     <br><div style="text-align: center;"><big>
    
    ID:<?=$pieID?>
    
    <BR>
    Owner:<?=$pieOwner?>
    
    <BR>
    Kind:<?=$pieKind?>
    
    <BR>
    Baked:<?=$pieBaked?>
    
    <BR>
    CHEK:<?=$pieCHEK?>
    
    <BR>
    </big> </div>
     </td>
    </tr>
    </tbody>
    </table>
    <--- END Pie List --->
    
    <BR>
    
    <?php
    
    ?>
    but here is the output (excerpting only the effected part):

    Code:
    &lt;------- start of pie list header ------&gt;
    <table style="width: 800px; height: 560px; text-align: left; margin-left: auto; margin-right: auto;" border="4" cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="vertical-align: top; text-align: center; background-color: rgb(153, 153, 255);">
    <div style="text-align: left;">
    <br>
    
    &lt;--- End of pie list header  ----&gt;
    
    &lt;--- Start Pie List ---&gt;
    <table style="background-color: rgb(255, 255, 204); width: 700px; height: 131px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="width: 50px; text-align: left; vertical-align: middle;">
    </td></tr></tbody></table><table style="background-color: rgb(255, 255, 204); width: 700px; height: 131px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="width: 50px; text-align: left; vertical-align: middle;">
    <img style="width: 79px; height: 45px;" alt="" src="%0A%0A%3Cx=$pieimgx%3E%0A%0A" hspace="10" align="middle"> </td>
    <td>
     <br><div style="text-align: center;"><big>
    
    ID:2
    <br>
    Owner:WaxyChicken
    <br>
    Kind:PIE
    <br>
    Baked:0000-00-00 00:00:00
    <br>
    CHEK:BLANK
    <br>
    </big> </div>
     </td>
    </tr>
    </tbody>
    </table>
    &lt;--- END Pie List ---&gt;
    
    <br>
    
    
    &lt;--- Start Pie List ---&gt;
    <table style="background-color: rgb(255, 255, 204); width: 700px; height: 131px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="width: 50px; text-align: left; vertical-align: middle;">
    <img style="width: 79px; height: 45px;" alt="" src="%0A%0A%3Cx=$pieimgx%3E%0A%0A" hspace="10" align="middle"> </td>
    <td>
     <br><div style="text-align: center;"><big>
    
    ID:3
    <br>
    Owner:WaxyChicken
    <br>
    Kind:CowPie
    <br>
    Baked:0000-00-00 00:00:00
    <br>
    CHEK:BLANK
    <br>
    </big> </div>
     </td>
    </tr>
    </tbody>
    </table>
    &lt;--- END Pie List ---&gt;
    You will notice that the first "&lt;--- Start Pie List ---&gt;" has extra close tags in it for table and a few other things. But i cannot find what it's coming from.
    I have found that if i exclude the "StartPieList.php" then the problem is resolved, but that also removes the intended layout.



    As for all the frekystuff ( playing with the ?> and <?php , adding in <----StartPieList etc....) i was seeing if that was the problem and was also trying to narrow down the cause. those 2 basic elements are not the cause of the problem.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    5
    Rep Power
    0
    the screenshot isn't going through. Apparently bots are better at Capcha's than i am.

    but a screenshot is available here:

    img29.imageshack.us/img29/7857/ghostjd.png
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Location
    Jakarta, Indonesia.
    Posts
    218
    Rep Power
    32
    One extra <?php near <--- End of pie list header ----> ?
    If not, then try Notepadd++ softw. to find any missing pairs
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    5
    Rep Power
    0
    Originally Posted by hdewantara
    One extra <?php near <--- End of pie list header ----> ?
    If not, then try Notepadd++ softw. to find any missing pairs
    No. that was part of me trying different header/footers to find out if that could be effecting it.

    and that doesn't explain where the automatically closing tags are coming from.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    5
    Rep Power
    0
    .


    does PHP ever automatically close HTML tags?

    I have found that if i exclude the "StartPieList.php" then the problem is resolved, but that also removes the intended layout.
  10. #6
  11. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,555
    Rep Power
    2338
    Originally Posted by WaxyChicken
    .


    does PHP ever automatically close HTML tags?
    No. Browsers might.
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    5
    Rep Power
    0
    Originally Posted by ptr2void
    No. Browsers might.
    but i doubt that firefox would close tags before the page even finishes loading.
  14. #8
  15. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Firefox does its best with bad HTML. This is bad HTML.

    Code:
    <img style="width: 79px; height: 45px;" alt="" src="
    
    <x=$pieimgx>
    
    " hspace="10" align="middle">
    Why is your image source the string "<x=$pieimgx>" with 2 newlines on either side? Did you maybe mean for this to be a <?php ?> tag?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    74
    Rep Power
    19
    * add a doctype
    * move css to an external file
    * replace deprecated elements
    * use proper opening and closing tags
    * switch to UTF-8

IMN logo majestic logo threadwatch logo seochat tools logo