Simple PHP question

Discussion in 'Web Design and Development (archive)' started by pepeleuepe, Jan 26, 2004.

  1. pepeleuepe macrumors 6502

    Oct 27, 2002
    Los Angeles, California
    First off, the problem I am trying to solve:

    1. I have a page on my site that I want to be loosely secure, basically a user can't just click through to get to the page. I don't want it to be bulletproof by any means and I don't even care if it is linkable or bookmarkable, just some kind of quasi-security to stop prying, computer illiterate eyes from seeing the page.

    2. I also have a phpbb database of users already registered.


    Make a script to access the phpbb database logins and passwords and determine if the user will be passed on to the page, or rejected.

    Well, I have everything working fine except for the very very last and seemingly simple part. Once the script determines that the user is authorized, how do I redirect the user to the next page? I'm new to PHP, but not to programming, and have found everything else I need in books or on, but I can't seem to stumble across a means of implementing this. I'm sure its one simple line of code, but I can't seem to find it, so if you can help, please do.
  2. colocolo macrumors 6502

    Jan 17, 2002
    Santiago, Chile
    The simplest way, and what I do most of the time, is to just close php and redirecto throgh javascript; it will address just fine your problem.
    something like:

    if (authorized)
    echo("Access denied");
  3. Singen macrumors newbie

    Jan 27, 2004
    And by using PHP

    Also, you can use PHP to send http headers. So, within PHP just:


    if($authenticated) {
    } else {

    By using this the client browser doesn't need to have javascript support.

Share This Page