문제

Such as "Username not found", "Problems logging you off", "Logout successful", and so on. Any feedback the website needs to give the user.

I made a class Feedback_Messages, declaring in instance of itself upon running (called in the page header). All messages are stored in a 3D array, according to message type (i.e. error, positive,...). A Get Message function prints out all of the waiting messages (I can make it look fancy when it's done).

Sometimes it works. Before I get into debugging, is this even a good way of doing this, or is there a best practice or available project to manage messages from different class objects to the user? Maybe in session? I'm new to php.

Thanks!

도움이 되었습니까?

해결책

Use a 'flash' system to store the message in session, and display it on the next page viewed before removing the flash.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top