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
https://forums.phpfreaks.com/topic/221627-error-messages/
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
https://forums.phpfreaks.com/topic/221627-error-messages/#findComment-1147195
Share on other sites

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.