Results 1 to 3 of 3

Thread: [RESOLVED] prevent user from accessing *.htm files with lack of php cookie?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    Resolved [RESOLVED] prevent user from accessing *.htm files with lack of php cookie?

    Hello all.
    Is it possible to "block" users from accessing *.htm files if the user does not have a cookie set by setcookie()?
    The only thing I can think of is to use JavaScript to check for the cookie's existence, then redirect upon failure.
    Any other ideas?
    Many thanks.
    Last edited by solitario; Jul 29th, 2008 at 07:49 AM. Reason: resolved

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: prevent user from accessing *.htm files with lack of php cookie?

    As HTML pages are static, the only option open to you would be the use of server side includes in Apache. I would suggest you convert the page in question to a PHP script and use PHP to check for the cookie and redirect the page when it does not exist.

    Using Javascript is not an option as the user can easily by-pass it by disabling Javascript.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    Re: prevent user from accessing *.htm files with lack of php cookie?

    That's what I thought. Thanks again visualAd.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width