• PHP Trivia

    From Spectre@21:3/101 to alterego on Thursday, September 24, 2020 03:02:00
    There doesnt appear to be anything unusual with that snippet of PHP.

    It doesn't appear to be getting the session variables across... I might have ot





































































































































    go and have a look at the naming.

    Spec


    --- SuperBBS v1.17-3 (Eval)
    * Origin: (21:3/101)
  • From Spectre@21:3/101 to alterego on Thursday, September 24, 2020 03:46:00
    There doesnt appear to be anything unusual with that snippet of PHP.

    Well assuming all the sessions code is right, I went back an started trying to follow the logic of the thing again... It was running afoul of another couple of $_HTTP_POST_VARS statements after another post form further in. Seems to be reasonably functional now. I just have to get some questions in place to test further.

    Spec


    --- SuperBBS v1.17-3 (Eval)
    * Origin: (21:3/101)
  • From Spectre@21:3/101 to Anybody on Monday, September 21, 2020 18:59:00
    PHP pain continues unabated. I'm working with an ANTIQUE script from somewhere... we can tell its an antique because its trying to use $_HTTP_POST_VARS instead of $_POST that was easy enough to find and fix but its







































































































































    also trying to use sessions to shift values to subsequent script portions.

    I've never come across sessions before, and so far as I can tell they aren't working despite entering values into the post form the contents remain steadfastly empty. So its not letting anyone log in or create themselves a user.

    Suggestions? I s'pose the top one is find a more recent trivia game, although this one seems to otherwise fit the bill. Is there anything obviously wrong with this?

    session_start();

    if (empty($_SESSION))
    {
    $_SESSION['action'] = $strAction = "Create New User";
    }
    else
    {
    if (strlen(trim($_SESSION['name'])) > 0)
    {
    $strName = $_SESSION['name'];
    $_SESSION['action'] = $strAction = "Change Password";
    }
    else
    {
    $strName = "";
    $_SESSION['action'] = $strAction = "Create New User";
    }

    if (!empty($_SESSION['message']))
    {
    $strMessage = trim($_SESSION['message']);
    }
    }


    Spec


    --- SuperBBS v1.17-3 (Eval)
    * Origin: (21:3/101)