Announcement

Collapse
No announcement yet.

Global Variables

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Global Variables

    After the last update of Scriptcase the global variable doesn't work.
    In my login form on validate I've this code:

    $usr = {user};
    $pwd = {password};
    $sql = "SELECT
    user,
    password,
    IDdipendente
    FROM
    dipendenti
    WHERE
    (user = '".$usr."') AND
    (password = '".$pwd."')";
    sc_lookup(ds, $sql);
    if (isset({ds[0][0]}))
    {
    $usr_login = {ds[0][2]};
    sc_set_global($usr_login);
    sc_redir(menu)
    }
    else
    {
    echo "Nome utente o password errati";

    }

    and in the application I use [usr_login]. And has always worked. But after last update It doesn't work.
    somebody can help me?

  • #2
    sc_set_global() is depraced (WebHelp: "This macro will be discontinued soon."). Use [usr_login] = {ds[0][2]};
    Best regards: - Reinhard -

    I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

    Comment


    • #3
      The sc_set_global macro still works on 0030.

      Mirko, check the "Application->Global Variables" section of the applications that use [usr_login] and make sure that global variable is defined as a SESSION variable, and that [x] In is checked on the apps that use it. Your login app should probably declare the variable as [x] Out.

      When the Application->Global Variables is not set up properly, the behavior is unpredictable: it might work fine, it might not.

      If your variable doesn't appear in Application->Global Variables, add the following code to the app's onScriptInit event:
      Code:
      $user = [usr_login];
      Save the application, and go back to Application->Global Variables. It will be there now.
      Last edited by Giblet535; 02-10-2015, 09:45 AM.

      Comment


      • #4
        sc_set_global() is depraced
        Yes, the docs tell that for years now, but it's still there and even the fresh generated security module is still using this. I advise to use the [] notation, but I don't expect to see this macro leave soon.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment

        Working...
        X