Inconsistent PHP Output
Posted: Thu Apr 22, 2010 10:29 pm
Hey everyone,
I'm having a bit of a weird problem. I have a while loop that iterates 9 times. Each time it outputs the following PHP code:
Most times this outputs the correct html which is:
But every once in a while it outputs the following instead which totally breaks my layout:
It most often hits on the 8th iteration of the while loop. I have no idea why the HTML output would be inconsistent as to what I'm actually writing in PHP. I don't even know where it's getting the alternate HTML code from as it is nowhere to be found anywhere in my source code.
I'm stumped.
I'm having a bit of a weird problem. I have a while loop that iterates 9 times. Each time it outputs the following PHP code:
Code: Select all
<div class="thumbnail"><a href="<?= $site_root?><?= str_replace(" ", "_", $name)?>/">
<div class="thumbnail-pic"><img src="<?= $site_root ?>media/profiles/<?= $id ?>/main.jpg" /></div>
<div class="thumbnail-info"><strong><?= $name ?></strong><br />
<?= $city ?>, <?= $state ?></div></a>
</div>Code: Select all
<div class="thumbnail"><a href="/John_Damon/">
<div class="thumbnail-pic"><img src="/media/profiles/6/p/47/382_tn.jpg"></div>
<div class="thumbnail-info"><strong>John Damon</strong><br>Oakland, CA</div></a>
</div>Code: Select all
<div class="thumbnail"><a href="/John_Damon/"> </a>
<div class="thumbnail-pic"><a href="/John_Damon/"><img src="/media/profiles/6/p/47/382_tn.jpg"></a></div>
<a href="/John_Damon/"> </a> <div class="thumbnail-info"><a href="/John_Damon/"><strong>John Damon</strong><br>Oakland, CA</a></div></a>
</div>I'm stumped.