hassank1 Posted May 14, 2008 Share Posted May 14, 2008 hii I am working on a system where users can post topics ! so I've remarked that when I use this expression <- !! the message is cut !!! ex: "hi hello <- this is a hello " so the output would be only : " hi hello " any explination ? thx Link to comment https://forums.phpfreaks.com/topic/105604-solved-lt-a-weird-problem/ Share on other sites More sharing options...
DarkWater Posted May 14, 2008 Share Posted May 14, 2008 You need help with it, or do you actually have a question? Link to comment https://forums.phpfreaks.com/topic/105604-solved-lt-a-weird-problem/#findComment-541005 Share on other sites More sharing options...
hassank1 Posted May 14, 2008 Author Share Posted May 14, 2008 what do u mean ?? that's my question.. why this is happening ? I am using php .. and what I do is cleaning the html tags and converting nl2br .. then I print it .. but donno y this is happening ! if the problem isn't clear I can explain with more details ! thx Link to comment https://forums.phpfreaks.com/topic/105604-solved-lt-a-weird-problem/#findComment-541006 Share on other sites More sharing options...
kenrbnsn Posted May 14, 2008 Share Posted May 14, 2008 The browser is eating the "<" because it thinks it's the start of a tag. Use "<" instead of "<". Ken Link to comment https://forums.phpfreaks.com/topic/105604-solved-lt-a-weird-problem/#findComment-541010 Share on other sites More sharing options...
hassank1 Posted May 14, 2008 Author Share Posted May 14, 2008 aha ok thx .. Ok so what I should do is simply replacing '<' by '"<' ... btw what about '>' should I replace it too ? and with what ? Link to comment https://forums.phpfreaks.com/topic/105604-solved-lt-a-weird-problem/#findComment-541013 Share on other sites More sharing options...
PFMaBiSmAd Posted May 14, 2008 Share Posted May 14, 2008 You need to pass all posted content through htmlentities(), using ENT_QUOTES as the second parameter, when you output it so that all special characters are converted to HTML entities so that they are not rendered by the browser and display exactly as entered. Link to comment https://forums.phpfreaks.com/topic/105604-solved-lt-a-weird-problem/#findComment-541021 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.