0

I have a admin folder where various .html files are there what happening is when i type http://mydomain.com/index.html it opens up a page and various other page but i want to put restrictions that if user is logined then only he can open other pages otherwise not.

What i know is this can done using session variable like putting is_login=true in session redirecting page according to that,but my all pages are .html not .php and is there any other way of doing??

3
Contributors
2
Replies
15
Views
1 Year
Discussion Span
Last Post by TexWiller
0

If all pages are of html, then use javascript, store session variable through javascript, which IDE are you using? this may help in understanding this problem.

If you are thinking through htaccess, then make directory pasword protected. only admin or user you want to access those pages can access particuler directory.

Regards,

-1

Simply include your html page in a .php script

<?php
if(isset($_SESSION['login'])
    require_once("pageA.html");
else
    require_once(pageB.html);

?>

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.