Jump to content

Recommended Posts

Hi, I'm afraid I'm quite new to PHP so please go easy on me  :shy:

 

I have the following code in my page which helps me to parse BbCode from a database field:

 

<?php
include('bbcode.php');
$bbcode = new bbcode;
$blogoutput = $row_Blogs['Content'];
$bbcode->parse($blogoutput);
?>

 

I then echo out the result further down the page with this code:

 

<?php echo $bbcode->parse($blogoutput); ?>

 

This line of code sits inside a repeat region that echo's out multiple divs with the content from each row.

 

Now on a page without a repeat region this works fine but I cant get it to work with the repeat region, it just outputs the same record each time.  I understand why its not working but unfortunately I lack the coding knowledge to rectify it.

 

This is the code for the DIV the repeat region applies to:

 

<form action="" method="get" name="BlogEntry">
                  <div id="blogbox">
                    <table width="100%" border="0">
                      <tr>
                        <td width="63%" valign="middle"><h1><?php echo $row_Blogs['Title']; ?>
                          <input name="BlogID" type="hidden" id="BlogID" value="<?php echo $row_Blogs['BlogID']; ?>" />
                        </h1>                        </td>
                        <td width="37%" valign="middle"> <a href="editblog.php?BlogID=<?php echo $row_Blogs['BlogID']; ?>"><img src="images/edit.gif" alt="Edit Blog" border="0" align="middle" /></a>  <input name="Delete" type="image" id="Delete" value="Delete" src="images/stddeletebutton.gif" align="middle" /></td>
                      </tr>
                      <tr>
                        <td colspan="2"><span class="style1">Posted by <a href="userprofile.php?UserID=<?php echo $row_Blogs['UserID']; ?>"><?php echo $row_Blogs['Username']; ?></a> on <?php echo $row_Blogs['DateCreated']; ?></span></td>
                      </tr>
                      <tr>
                        <td colspan="2" style="padding-top:5px;"><?php echo $bbcode->parse($blogoutput); ?></td>
                      </tr>
                    </table>
                  </div>
                  </form>
                  <?php } while ($row_Blogs = mysql_fetch_assoc($Blogs)); ?>

 

If you need any more info or more of the page code let me know.

 

Thanks

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/194846-repeat-region-help-needed/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.