acces restriction from variable

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


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2006
John Olav
 
Posts: n/a
Default acces restriction from variable

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?


Reply With Quote
  #2 (permalink)  
Old 04-17-2006
Don Khuth
 
Posts: n/a
Default Re: acces restriction from variable

"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.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:01 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0