Jump to content

[SOLVED] integration of my php login and html


andybrooke

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

 

 

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.