Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts

    checking phpBB status

    I'm as rusty as the tin man...

    the below needs to be triggered by an onclick within a PHP page's div but I'm not sure it can because the headers already been sent?

    Code:
    if($userdata['session_logged_in'])
    {
    return true;
    }
    else
    {
    header('Location: http://site.com/board/login.php/');
    }
    Last edited by zoobie; 07-31-2008 at 12:56 AM.
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    You can't catch onclicks with PHP at all, because by the time the user can click PHP is done with the page, it has been generated, sent to the user, and loading in their browser. You're looking for JavaScript if you want to do onclicks.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    For my purposes, I've got it...a dummy page of links that's always checking for login...then it redirects to the real page of when found.


    zoobie has a little shameless behaviour in the future, too
    Last edited by zoobie; 07-31-2008 at 04:25 AM.
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #4
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    um, why are you waiting for a click to check to see if they're logged in? why not just make the page load conditional?

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ...because I want them to see the page before being forced to join...that's how considerate I am
    I can also just echo out whatever I want them to see...whether it's a page of blank links or a page with real ones...this way, there is no hidden page

    my only question now is, can i echo an included script?
    include("script.php");
    Last edited by zoobie; 07-31-2008 at 06:21 AM.
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">


  •  

    Posting Permissions

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