Ashish Sood Posted December 20, 2012 Share Posted December 20, 2012 Hi , By default in php error shows on the upper left corner of the page, but how could is show error on the specific part of the page. Any IDEA Thanks Link to comment Share on other sites More sharing options...
birbal Posted December 20, 2012 Share Posted December 20, 2012 Why you need that? php errors are for developer not for your user. showing error publicaly is a kind of security flaws. you would like to consider other way. you can use custom error handling instead. 1 Link to comment Share on other sites More sharing options...
thescientist Posted December 20, 2012 Share Posted December 20, 2012 the point of getting error messages is so you as the developer can fix them so hopefully your users don't see them, not so you can tuck them away or ignore them. Link to comment Share on other sites More sharing options...
Ashish Sood Posted December 21, 2012 Author Share Posted December 21, 2012 Ohh you guys got me wrong. I mean to ask that if i am using "if" condition and the condition get fail (may be user supplied invalid username & password) then i have to show a error message to user like" invalid credentials". which is always show on the top left corner of the page... But i want the error message to show where is want the page. Hope you guys understand my queries Link to comment Share on other sites More sharing options...
birbal Posted December 21, 2012 Share Posted December 21, 2012 It is up to your CSS where and how you show the output, in this case custom errors you can encolse the error in div and set up some class or id to get it styled as you want. Link to comment Share on other sites More sharing options...
Ashish Sood Posted December 21, 2012 Author Share Posted December 21, 2012 @Birbal Could you give me example, so will be more clear to me. Link to comment Share on other sites More sharing options...
birbal Posted December 21, 2012 Share Posted December 21, 2012 echo "<div class='error'>Invalid Credential</div>"; now in style sheet you can set style for class 'error' .error{position:.............} 1 Link to comment Share on other sites More sharing options...
justsomeguy Posted December 21, 2012 Share Posted December 21, 2012 You also might not want to just echo out errors as they happen. Save them in an error variable, and then print that variable wherever you want the messages you appear on your page. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now