I'm trying to wrap $errors in DIV, but even though error messages are not displayed it still displays the Div block.
How can I program it that it would display the div only when the error is displayed?

This is the our output:

<?PHP
            echo "<div class='error-message'>";
             echo $errors;
             echo "</div>"; 
?>

I guess I can apply the div to each individual $error but when it displays all error messages, it will display them in the individual blocks. I would like them to be inclosed in one div block

if ($action == "update")
    {
    if (empty($firstName)  )
        {
        $errors .= "&raquo; First Name can not be empty";
        }
    if (empty($lastName))
        {
        $errors .= "<br/>&raquo; Last Name can not be empty";
        }
    if (empty($emailAddress))
        {
        $errors .= "&raquo; Email Address can not be empty";
        }

if (empty($coName))
    {
    $errors .= "&raquo; Company Name can not be empty";
    }
if (empty($phoneOffice))
    {
    $errors .= "<div class='error-message'>&raquo; Office Phone can not be empty</div>";
    }

if ($errors == "")
    {
    if(!empty($errors))
    {
       echo "<div class='error-message'>$errors</div>"; 
    }
    

    PS: Welcome to the forum, and note that I changed your [noparse]

     tags to [code=php]...

    [/noparse] tags.

      WOW, you're good
      thanks man.

      I will take note of php tags

        Write a Reply...