Jump to content

[SOLVED] Need help with Echo Div bug


bgbs

Recommended Posts

I would like someone to help me figure out this echo bug with DIV.

The code below is a feedback block.  When there is feedback left for the user, then echo div gets added and it screws up all my css as a result. This div is an extra element that should be wrapper correctly.  If I simply remove the echo DIV it messes CSS another way.  So I think there I need to add begging div somewhere else above in the code. I dont know enough about PHP coding to be able to fix this problem. Your help is appreciated.

 

 

    <div class="account-left-column"><div><img src="images/account-left-column-back-top.gif" alt="" /></div><div class="account-left-column-header">FEEDBACK for <?PHP echo $vuser->first_name; ?></div>

   

    <div class="account-left-column-content">

      <?PHP

        $feedback = getFeedback($v_id,"to");

 

if (count($feedback) > 0)

{

 

$counterstart = 0;

 

 

 

 

foreach ($feedback as $fback)

{

$counterstart++;

if($counterstart % 2)

{$feedbackstyle = "background-color:#fff";}

else

{$feedbackstyle = "background-color:#fff";}

 

echo '<div style="padding:5px 5px 5px 5px;'.$feedbackstyle.'">';

echo "<a href='user.php?v_id=$fback->co_user_id'>$fback->first_name $fback->last_name ($fback->co_name)</a> rated <strong>$fback->message_rating/5</strong>  <div class='feedback-message'>\"$fback->message\" (".substr($fback->message_date,0,10).")                      </div>";

 

//resolution of feedback

$current_user_id = currentUserID();

if ($current_user_id == $v_id)

{

// the person that is viewing the feedback, is the same as the for who the feedback was left for

// so we can display the resolve feedback link

 

echo "<a href='feedback_resolve.php?feedbackid=$fback->feedback_id'><font color=red>Click to resolve this feedback.</font></a>";

 

}

 

 

echo "</div>";

}

}

else

{

echo "<p>No feedback for this user</p>";

}

 

?>

      <?PHP

if ($current_user_id != $v_id)

{ //don't allow people to leave feedback for themselves

?>

      <div class="account-button"><a href="feedback.php?to_id=<?PHP echo $v_id; ?>">Leave feedback for <?PHP echo $vuser->first_name; ?></a>

        <?PHP

  }

  ?>

      </div>

    </div>

  <div><img src="images/account-left-column-back-bottom.gif" alt="" /></div></div>

    <!--<end of .account-left-column>-->

Link to comment
https://forums.phpfreaks.com/topic/179978-solved-need-help-with-echo-div-bug/
Share on other sites

I would like someone to help me figure out to solve this echo bug with DIV.

The code below is a Feedback Block.  When there is feedback left for the user, it adds the echo div and it screws up all my css as a result. This div is an extra element that should be wrapper correctly.  If I simply remove the echo DIV it messes CSS another way.  So I think there I need to add begging div somewhere else above in the code. I dont know enough about PHP coding to be able to fix this problem. Your help is appreciated.

 

 

    <div class="account-left-column"><div><img src="images/account-left-column-back-top.gif" alt="" /></div><div class="account-left-column-header">FEEDBACK for <?PHP echo $vuser->first_name; ?></div>

   

    <div class="account-left-column-content">

      <?PHP

        $feedback = getFeedback($v_id,"to");

 

if (count($feedback) > 0)

{

 

$counterstart = 0;

 

 

 

 

foreach ($feedback as $fback)

{

$counterstart++;

if($counterstart % 2)

{$feedbackstyle = "background-color:#fff";}

else

{$feedbackstyle = "background-color:#fff";}

 

echo '<div style="padding:5px 5px 5px 5px;'.$feedbackstyle.'">';

echo "<a href='user.php?v_id=$fback->co_user_id'>$fback->first_name $fback->last_name ($fback->co_name)</a> rated <strong>$fback->message_rating/5</strong>  <div class='feedback-message'>\"$fback->message\" (".substr($fback->message_date,0,10).")                      </div>";

 

//resolution of feedback

$current_user_id = currentUserID();

if ($current_user_id == $v_id)

{

// the person that is viewing the feedback, is the same as the for who the feedback was left for

// so we can display the resolve feedback link

 

echo "<a href='feedback_resolve.php?feedbackid=$fback->feedback_id'><font color=red>Click to resolve this feedback.</font></a>";

 

}

 

 

echo "</div>";

}

}

else

{

echo "<p>No feedback for this user</p>";

}

 

?>

      <?PHP

if ($current_user_id != $v_id)

{ //don't allow people to leave feedback for themselves

?>

      <div class="account-button"><a href="feedback.php?to_id=<?PHP echo $v_id; ?>">Leave feedback for <?PHP echo $vuser->first_name; ?></a>

        <?PHP

  }

  ?>

      </div>

    </div>

  <div><img src="images/account-left-column-back-bottom.gif" alt="" /></div></div>

    <!--<end of .account-left-column>-->

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.