close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

PHP Repeat Region not working when the repeat region contains a Server Side Include?

Thread began 2/11/2014 7:02 am by Nathon Jones Web Design | Last modified 2/14/2014 10:29 am by Nathon Jones Web Design | 2562 views | 17 replies

Nathon Jones Web Design

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>&nbsp;</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

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...