Announcement

Collapse
No announcement yet.

How to pass username between forms

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

  • How to pass username between forms

    Hello,

    I'm a new user to SC and currently i have doubts in passing variables between forms. I have a log in form that redirects to another form that instructs users to enter some data. The form where the users enter data should show only the name of logged user in one of the fields. Currently i am using a straight-away lookup from the user tables. This shows all the users. How can i accomplish this.

    Thanks.

  • #2
    Parameters are useually passed by a global variable. You can recognize these as variables between []. If you look in the generated loginmodule you will see that the variables you need are registered by sc_set_global, a deprecated function. But these variables can be used anywhere if you set them between [].

    Code:
    	sc_set_global($usr_login);
    	sc_set_global($usr_priv_admin);
    	sc_set_global($usr_name);
    	sc_set_global($usr_email);
    In your case you can access the username by the using [usr_name] in your other applications. This global variable can also be used in header or footer, ie: welcome: [usr_name]
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Thanks aducom. Will try this

      Comment


      • #4
        Some extention to this, I need to pass an array between app.

        array (size=9)
        0 =>
        array (size=2)
        0 => int 175
        1 => string 'a' (length=1)
        1 =>
        array (size=2)
        0 => int 202
        1 => string 'b' (length=1)
        2 =>
        array (size=2)
        0 => int 190
        1 => string 'c' (length=1)
        3 =>
        array (size=2)
        0 => int 203
        1 => string 'd' (length=1)

        When using sc_set_global($players) the global variable is reated but contains 'array'.

        So how can i transfer this (a multidimentional array) between apps.

        BR
        Danny

        Comment


        • #5
          Originally posted by rodiusd View Post
          Some extention to this, I need to pass an array between app.

          When using sc_set_global($players) the global variable is reated but contains 'array'.

          So how can i transfer this (a multidimentional array) between apps.

          BR
          Danny
          Don't use sc_set_global as this is a deprecated function. You just declare your global by puting them between brackets.

          [myarray]= etc.
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development
          www.scriptcase.eu / www.scriptcase.nl

          Comment


          • #6
            Hello,

            I'm a new user to SC and currently i have doubts in passing variables between forms. I have a log in form that redirects to another form that instructs users to enter some data.
            http://www.vcedownload.net/download-vce.php
            http://www.uam.es/
            http://www.checkpoint.com/
            http://www.wisc.edu/

            Comment


            • #7
              You can pass data using global variables. In SC you put them between []. If you redirect you can set the variables in the sc_redir function. Best way to start is by following the video tutorial on the main website of SC describing this.
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development
              www.scriptcase.eu / www.scriptcase.nl

              Comment

              Working...
              X