PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm trying to make a login page that directs the user to a page where they can edit the news mysql table. The problem I have is I can't seem to get the members page to get the $username of the person logged in. I am probably completely wrong from what I have so far, but from my little knowledge of what I've been practicing it looks right to me.
A blank page would suggest a parse error unless your page logic simply wouldn't print something at all.
session_write_close() may be of interest. Also, note that header() based redirection requires full URLs, http:// and all to maintain standards compliance.
This is a fairly common problem, but the solution is not obvious.
If you redirect you are still within the same HTTP request. The session is only written when the request is complete. That means that the values set on the first page have not been written when the second page reads the session file. Use session_write_close() on the first page to write the values to the session file before redirecting.