Ok, here is my situation. I am very new to PHP & MYSQL. Prior to learning this I was only experienced with HTML so I am pretty green and I have a couple of questions:
1. I am developing a site where I will have about 10 pages which will only be for members who have registered for my website. Here is my question. I plan to use PHP/MYSQL to verify that the user name matches password etc.. in the MYSQL database to allow access to these pages. My problem is that I don't know how to keep someone logged in without them having to log in each time they switch pages. Should I only have links to the proteced pages through 1 protected page. Then the user could just log in and go to a members page which would have links to the protected page? The downside is if they click on an unprotected page then try to go back to a protected page they will have to re-login. Or is there a better way?
2. Also could I set up a PHP script for links to pages, then if they change I can just update the script instead of updating every link in the site? I think I know how to do this. Is this a good idea?
3. Last is there a way to carry data output from a PHP script to the next page? Example. I have a login page that asks for e-mail and password. I query mySQL database to verify that they match. I then want to open a "member" page which will have about 5 places where I need to insert data from this members database. So assuming the password is correct the new page opens and there is a table data cell where I want the user's name from the database to appear there as text. My problem is that after I run the php script on the login page it directs me to a new page. This new page does not know who this user is, as it is a master page with places that need info from the mysql database. Is there a way to carry over output from the login page so that the php script would have something to compare to and locate desired data? Or would the user need to enter their data again on this page?
1. I am developing a site where I will have about 10 pages which will only be for members who have registered for my website. Here is my question. I plan to use PHP/MYSQL to verify that the user name matches password etc.. in the MYSQL database to allow access to these pages. My problem is that I don't know how to keep someone logged in without them having to log in each time they switch pages. Should I only have links to the proteced pages through 1 protected page. Then the user could just log in and go to a members page which would have links to the protected page? The downside is if they click on an unprotected page then try to go back to a protected page they will have to re-login. Or is there a better way?
2. Also could I set up a PHP script for links to pages, then if they change I can just update the script instead of updating every link in the site? I think I know how to do this. Is this a good idea?
3. Last is there a way to carry data output from a PHP script to the next page? Example. I have a login page that asks for e-mail and password. I query mySQL database to verify that they match. I then want to open a "member" page which will have about 5 places where I need to insert data from this members database. So assuming the password is correct the new page opens and there is a table data cell where I want the user's name from the database to appear there as text. My problem is that after I run the php script on the login page it directs me to a new page. This new page does not know who this user is, as it is a master page with places that need info from the mysql database. Is there a way to carry over output from the login page so that the php script would have something to compare to and locate desired data? Or would the user need to enter their data again on this page?