Forum Moderators: coopster
For example, I have a log-in process which validates username and password of members, and also retricts access to certain pages. So if a member goes into a page without logging in, the member will be presented with a form to log in. How can I make my script go back to the previous page they were trying to access prior to logging in?
2. What would happen if I use ob_start and ob_end_flush() on every page that I have? Would it affect loading time? Or would loading time be the same except that it would cache everything first? Isn't that suppose to make it appear that the page loads fast?
How can I make my script go back to the previous page they were trying to access prior to logging in?
I don't know whether this is the best solution, but... Presumably you have a session running if you have a login.
When the person gets forwarded to the login page, before forwarding, set a $_SESSION['referer'] variable. Use that to create a hidden field in the login form. That data will then be posted and when you process the login, you cna check the session var and, if it's set, use
header("Location:..");
to send them back where they came from
Don't know about buffering and load times...
Tom