title: htaccess with html form
body: <p>Is possible to use .httaccess to some place on the server via html form?<br />
  Suppose we can use php, html, javascript, .httaccess 
  <br />
  I will explain it. <br />
  For example I will have www.myserver.com/administration/<br />
  In folder administration will be some filestructure for administrator and only authorized users shoul be able to access it. <br />
  <br />
  One option is use simple .htaccess rule and you will need to access thought that ugly grey popup which consist of login and password. <br />
  <br />
  Second option is use standard session notification in php - form in html send it via post, proccess it in php script, if you have right login and pass, create session and then check session on each page you need login for.
  <br />
  Third option - why don't mix it a bit. I don't know if its possible so this is my question:
  Let's have same html form we would use for login via php with sessions, we will send it by post method somehow to athentication mechanism which is behind the htaccess authentification, than if it pass redirect to admin folder www.myserver.com/administration/
  <br />
  suppose that login form is on www.myserver.com/login.php</p>
  
  <p>additional demands:
  1)if I'm not logged in - redirect to loggin.php or better show some error page with message
  so send to the error page some information via post for example set $_POST["message"] = "not logged"<br />
  2)be able to loggout - so assign logout action to some button html link ...<br />
  3)if its possible to folder is it possible set it only for specific filles on server or for some filestructure I'll define? for example login rule will be necessary for this 2 folders(all pages in it) and this 3 php pages which are somewhere else for exaple in third folder which will have protected only that 3 files and other will be accessible for everyone.<br />
  4)if this option is even possible is possible have more than one group of users?
  I suppose that htaccess authentification works just like you can pass and you can't pass.</p>
  
  <p>Hope somebody find the time to read this and answer it. My question is if its even possible do it this way I described. </p>