web development server - How can I write .htaccess so that it only gives access from the form? -


here code:

<files contacts.html> order allow,deny deny allow access.php </files> 

i not want contacts.html directly accessed url. have form on index.html page has form action access.php. once confirms, redirects contacts.html using header function.

you want use $_session,

on access.php

session_start();  // code here authenticate  $_session['hasaccess'] = true;  // redirect 

change contacts.html contacts.php , @ top of page

session_start();  if($_session['hasaccess'] !== true){      header('location: index.php');     die;  }  // rest of code 

Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -