PHP Repeat Region not working when the repeat region contains a Server Side Include?
We have added a repeat region to our page to repeat products from our MySQL database table.
It looks like this:
<?php do { ?>
<div class="prodfullpanel">
<div class="prodfullpaneltop">
<div class="prodfullpanelcol1">
<img src="led-light-bulbs/tmb/<?php echo $row_rsPRODFULL['LEDimgtmb']; ?>" width="120" height="120" style="border:none;" /><br />
<?php if ($row_rsPRODFULL['LEDwattage'] > 0) { // Show if column... ?>
<?php
$wattvalue=$row_rsPRODFULL['LEDwattage'];
echo str_replace('.0', '', $wattvalue);
?> Watt
<?php } // Show if column... ?>
</div>
<div class="prodfullpanelcol2">
<span class="h2style"><?php echo $row_rsPRODFULL['LEDtitle']; ?></span><br />
<span class="orange"><?php echo $row_rsPRODFULL['LEDproductcode']; ?></span>
<div class="pagefull">
<div class="page33">
<p>Brightness</p>
</div>
<div class="page34">
<p>Beam Angle<br />
<?php
if ($row_rsPRODFULL['LEDbeamangle']=="36")
{echo "<img src='plugins/beam-angles/36.png' width='75px' height='75px' />";}
elseif ($row_rsPRODFULL['LEDbeamangle']=="40")
{echo "<img src='plugins/beam-angles/40.png' width='75px' height='75px' />";}
elseif ($row_rsPRODFULL['LEDbeamangle']=="60")
{echo "<img src='plugins/beam-angles/60.png' width='75px' height='75px' />";}
elseif ($row_rsPRODFULL['LEDbeamangle']=="90")
{echo "<img src='plugins/beam-angles/90.png' width='75px' height='75px' />";}
elseif ($row_rsPRODFULL['LEDbeamangle']=="120")
{echo "<img src='plugins/beam-angles/120.png' width='75px' height='75px' />";}
?>
</p>
</div>
<div class="page33">
<p>Dimmable<br />
<?php
$dimm=$row_rsPRODFULL['LEDdimmable'];
if ($dimm=="True")
{echo "Yes";}
else
{echo "No";}
?>
</p>
</div>
</div>
<div class="pagefull">
<p>6 Year Warranty | 30 Day Hassle Free Returns</p>
</div>
</div>
<div class="prodfullpanelcol3">
<p><span class="h4style">£<?php echo $row_rsPRODFULL['LEDprice']; ?></span> inc. vat</p>
<p> </p>
</div>
</div>
</div>
<?php } while ($row_rsPRODFULL = mysql_fetch_assoc($rsPRODFULL)); ?>
We wanted to change this to be a Server Side Include so that we can make a change to one file and have it update all of our category pages so we changed it to this:
<?php do { ?>
<?php require_once("prodfullpanel.php"); ?>
<?php } while ($row_rsPRODFULL = mysql_fetch_assoc($rsPRODFULL)); ?>
prodfullpanel.php being the content that's in the first code block (above).
This causes the repeat region to stop working?
Can you not repeat Server Side Includes in PHP? We used this all the time in Classic ASP.
Would appreciate your advice. Thank you.
Regards
NJ