This is a discussion on acces restriction from variable within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Newbie qustion. Is it possible to restrict access to a file this way: a. User MUST access through file 1. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Newbie qustion. Is it possible to restrict access to a file this way:
a. User MUST access through file 1. File one has a variable that b. the restricted file (file 2, in another directory) request from file 1 in order to allow acces to it. File 1 is just a redirect file generated from a successful post, but with the required variable which file 2 has to recognize, otherwise not allow access to it. Possible? |
|
|||
|
"John Olav" <john.olav@bluezone.no> wrote in message
news:12458mfn2bm7kac@corp.supernews.com... > Newbie qustion. Is it possible to restrict access to a file this way: > a. User MUST access through file 1. File one has a variable that > b. the restricted file (file 2, in another directory) request from file 1 > in order to allow acces to it. > > File 1 is just a redirect file generated from a successful post, but with > the required variable which file 2 has to recognize, otherwise not allow > access to it. > > Possible? Of course that's possible. What you'll need to do is us $_SESSION variables. File 1 will set the variables while File 2 will read. File 2 will ask if a specific $_SESSION variable has been set, if not, no access is granted. Just add session_start(); at the top of both files and you're ready to go. |