Jump to content

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>-->

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.