Announcement

Collapse
No announcement yet.

Default values in session variables

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

  • Default values in session variables

    I am using some session variables in all my applications. Every time I start an application I have to give value to all these session variables.

    Is it possible to set default values ​​for these variables so that ScriptCase not ask me its values every time I start an application?

    Thanks

  • #2
    Hello,
    Do you have try to declare some values in event onload of the form?

    Best regards,
    Olivier

    Comment


    • #3
      If I do this in the onload event, I'll have to modify my applications before sending them to production.

      I'm looking for, if any, a way to give values ​​to my session variables without generating code need to modify later

      Comment


      • #4
        Originally posted by hectorgn View Post
        [...] so that ScriptCase not ask me its values every time I start an application?
        Application / Global Variable / <your_variable> / Type: Out (in your start app)

        Question: you mean session variable ala $_SESSION['user']['name'] or global variable ala [glo_user_name] ...? In the first case you have not trouble with default values and the type-declaration of global variables. Most of my apps use $_SESSION[...] and I have not much problems with any global variables.
        Best regards: - Reinhard -

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

        Comment


        • #5
          Reinhard,

          If you use $_SESSION a lot would you try the probem I have? Just add echo $_SESSION['id']; to your onscriptinit and start your app with ...?id=10

          I get an error.
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development
          www.scriptcase.eu / www.scriptcase.nl

          Comment


          • #6
            Hi Albert,

            why not use $_SESSION['id'] = $_GET['id']?
            Best regards: - Reinhard -

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

            Comment


            • #7
              Is there a way to use a session variable in the query for a Select field? I need to be able to use one and can't figure out how to do it.
              ​and I do mean session variable not a global variable

              Comment


              • #8
                Haven't tried it much but you can declare a global as a session variable. If you don't want that then the php $_SESSION superglobal is the way to go I guess.
                Albert Drent
                aducom software netherlands
                scriptcase partner, reseller, support and (turn-key) development
                www.scriptcase.eu / www.scriptcase.nl

                Comment

                Working...
                X