andybrooke Posted January 22, 2008 Share Posted January 22, 2008 hi. I am very new to php and have mangaged to create a php login for my website. It works fine and when you login it sends you to a members.php page. my question is: how do i get the html pages that i only want registered people to use to intigrate with this. I pressume all i need to do is paste some code on the html pages that i want to be only viewable to logged on people, and maybe save the pages as php but not 100% sure, as i am new to all this it would help if you could explain in plain english, if anyone can help you would be a life saver cheers Quote Link to comment https://forums.phpfreaks.com/topic/87232-solved-integration-of-my-php-login-and-html/ Share on other sites More sharing options...
revraz Posted January 22, 2008 Share Posted January 22, 2008 You would need to save the files as .php instead of .html if you want to parse PHP inside of it. For your secured area, just check a session variable if they are logged in, then display what they are allowed to see. Quote Link to comment https://forums.phpfreaks.com/topic/87232-solved-integration-of-my-php-login-and-html/#findComment-446206 Share on other sites More sharing options...
rhodesa Posted January 22, 2008 Share Posted January 22, 2008 You would need to save the files as .php instead of .html if you want to parse PHP inside of it. Renaming them to .php is the 'proper' way, and you should do this if possible. But if renaming the files and updating all the links on your page is not feasible, you can configure Apache to parse .html files with PHP. A quick Google search came up with this: http://www.desilva.biz/php/phpinhtml.html But keep in mind that all hosting configurations can be different, so if the steps in the link don't work, I would take at look at your your hosting companies FAQ or give them a call. Quote Link to comment https://forums.phpfreaks.com/topic/87232-solved-integration-of-my-php-login-and-html/#findComment-446212 Share on other sites More sharing options...
andybrooke Posted January 22, 2008 Author Share Posted January 22, 2008 Hi. I am being thick here but really dont have a clue as i am self teaching. im not sure how to create the "secured area" the index.php logs you on and directs you to a file called members.php. all the html files are located in another folder. should i move these to the same folder as the members.php location? also how do i check the session variables? and then edit what they can see. I understand that i will have to save the html files as php but what do i need to paste at the the top of each html page before i save as php? For your secured area, just check a session variable if they are logged in, then display what they are allowed to see. Quote Link to comment https://forums.phpfreaks.com/topic/87232-solved-integration-of-my-php-login-and-html/#findComment-446214 Share on other sites More sharing options...
revraz Posted January 22, 2008 Share Posted January 22, 2008 http://www.tizag.com/phpT/phpsessions.php Quote Link to comment https://forums.phpfreaks.com/topic/87232-solved-integration-of-my-php-login-and-html/#findComment-446220 Share on other sites More sharing options...
rhodesa Posted January 22, 2008 Share Posted January 22, 2008 http://www.tizag.com/phpT/phpsessions.php That is a great resource. Also, there are tons of tutorials on the web with help on creating a user login area. Here is one I found in a quick search: http://www.devshed.com/c/a/PHP/Creating-a-Secure-PHP-Login-Script/ Beyond that, you may want to try the freelance area to see if anyone is willing to write a script for you. Quote Link to comment https://forums.phpfreaks.com/topic/87232-solved-integration-of-my-php-login-and-html/#findComment-446224 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.