Jump to content

Error messages


fxuser

Recommended Posts

hello  , i have this code:

 

<?php

function error_table($err){
echo"<p><span class='textborder'>$err</span></p>";
}


?>

 

in a separate php file and then call it from another php file , like this :

 

$msg_err='bla bla';
error_table($msg_err);

 

when i click the button it shows the text with its border(the class has a border ,color and 1px)

but when i have the code inside other if functions it shows it 2 or 3 times...

Link to comment
Share on other sites

i have this in my code:

 

if submit then 
   if this1 then
      code
      if this2 then
          code
      else
         error_table($msg_err);
    else
       error_table($msg_err);
else
error_table($msg_err);

 

i dont have loops in my code... right now i edited the function to return the text and then echo it on the 3 spots in my code, on the first if it shows 1 table ,on the 2nd it shows the 1rst correct and then one more appears with no text .. and on 3rd it shows 2 more extra boxes

 

EDIT: as i see the problems occurs because i have the span in my code , if i use <p> only it works fine .. but why?

Link to comment
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.