fxuser Posted December 14, 2010 Share Posted December 14, 2010 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... Quote Link to comment https://forums.phpfreaks.com/topic/221627-error-messages/ Share on other sites More sharing options...
Adam Posted December 14, 2010 Share Posted December 14, 2010 The other functions will be getting called in a loop, or using a loop within them. Quote Link to comment https://forums.phpfreaks.com/topic/221627-error-messages/#findComment-1147186 Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2010 Share Posted December 14, 2010 If you want help with some of your code that is not working, you would need to post your code. Quote Link to comment https://forums.phpfreaks.com/topic/221627-error-messages/#findComment-1147188 Share on other sites More sharing options...
fxuser Posted December 14, 2010 Author Share Posted December 14, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/221627-error-messages/#findComment-1147195 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.