Global Variable in URL

Hi,


I have read post

http://forums.matrix.squiz.net/index.php?s…mode=linearplus



I am using Squiz MySource v3.22.1 (Matrix) . Can you guide me as of how i can create global variables and pass it to remote page in URL.



I have a login page in my website and i want to keep a log of people who are accessing pages. So i want to pass this userid everytime to remote page. Once i have userid on remote page i can change the links example from www.abc.com/xyz.asp to www.abc.com/xyz.asp?userid=aagarwal



Do you think setting global variable would serve the purpose, or i should think about something else.



Regards,

Anurag Agarwal


If you just wanted to do this, you would use %globals_get_userid%.

Hi nnhubbard,


Could you please pass me the link or the procedure to add global variables and use them in url… I am searching in manuals but couldnt find the steps to create global variables.



hope to hear you soon.

[quote]Hi nnhubbard,


Could you please pass me the link or the procedure to add global variables and use them in url… I am searching in manuals but couldnt find the steps to create global variables.



hope to hear you soon.[/quote]



The GET value is grabbed using the a globals keyword as I described above. You are wanting to use global variables? What are you meaning by this? These are global keywords…

I want to know the steps of creating global variable %globals_get_userid%. After that how can i assign value to this variable. After that how can i access in page. and how can i add this to url.


I am struggling to fidn in Matrix exactly where do i declare this global variable and how do we assign vlaueand access i



Hear you soon.

Hi Hubbard,


What i am doing is…



========================================

Training Courses



%globals_get_myvariable% = 'anurag'



Squiz offer a number of training courses including



MATR 10

MATR 201

Please download the Trainig Courses overview. The cousts for attending one of these courses is outlined in this document.



If you wish to enroll in one of the course you can contact us here.

===================================================



The training course has the link like xyz.asp?userid=%globals_get_myvariable%



and on xyz.asp page i am fetching the userid from URL, nut its NULL.



Can you tell me whether thier is anything wrong in this approach.

I am getting confused here.


Are you trying to use javascript variables, or?



%globals_get_myvariable% is only to grab the GET variable from a URL string IN Matrix. So, if in Matrix, you have a body copy with the keyword %globals_get_myvariable% in it, and the URL that took you to the page was www.mypage.com/test?myvariable=thisismyvar the page would print "thisismyvar" without quotes.



The globals keywords are just to grab a GET or POST.

Hi


If the user is logged in you can get a hold of their attributes through the global variables like %globals_user_assetid% or %globals_user_name%. You would use these keywords to construct your url like www.abc.com/xyz.asp?userid=%globals_user_name%. If you want to print the name of the user on the page then you would just use the global user keywords. Nic has given a good description of using a value that is passed already.

[quote]Hi


If the user is logged in you can get a hold of their attributes through the global variables like %globals_user_assetid% or %globals_user_name%. You would use these keywords to construct your url like www.abc.com/xyz.asp?userid=%globals_user_name%. If you want to print the name of the user on the page then you would just use the global user keywords. Nic has given a good description of using a value that is passed already.[/quote]

Great Idea Shane,



I just tested and it works!



Robin

Hi All…


I found this website and it solved all my queries related to passing userid…



http://matrixsecrets.com/2009/02/mysource-keywords



Very usefull site…



Regards,

Anurag Agarwal