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??

Recommended Answers

All 2 Replies

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,

Simply include your html page in a .php script

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

?>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.