MikeKohler
Technical User
Hi I have a question about sessions. In order to restrict access to a page I have seen the following code:
// Protected webpage
if($_SESSION['username']="whatever"){
// entire page}
else {
// Invalid User}
My question is, what happens if you have php code within the body of your page. How do you restructure this code so it takes into account there already being the tags <?php and ?> in the body. I have a section in a table that lists the contents of a folder. I want it so that someone has to login so that they can access this page.
Thank you,
Michael Kohler
// Protected webpage
if($_SESSION['username']="whatever"){
// entire page}
else {
// Invalid User}
My question is, what happens if you have php code within the body of your page. How do you restructure this code so it takes into account there already being the tags <?php and ?> in the body. I have a section in a table that lists the contents of a folder. I want it so that someone has to login so that they can access this page.
Thank you,
Michael Kohler