How to render a server variable in a dseigns parse file

(Van Tran) #1

Hi all,


this has been bugging me for a while, but I'm trying to output the current url on a login form as to pass on a referring url to an external authentication service.. I've read the manual and there is mention of server variable conditionals but all I really want to do is output the PHP variable $_SERVER['REQUEST_URI'] in a parse file.



(Bart Banda) #2

This should do it: %globals_server_REQUEST_URI%

(Van Tran) #3

Thanks Bart,


How can I use the keyword replacement within a MySource_PRINT element in the parse file?

(Bart Banda) #4

I don't think there is a mysource print tag that can print it, but you could use a declared var design area and put the globals keyword as the default value there, and print it using <MySource_PRINT id_name="server_var" var="request_uri_keyword" />.


Where in the parse file are you printing it though? Can't you just use the globals keyword to print it in the parse file? Why do you need to use the mysource print tag?

(Van Tran) #5

Thanks Bart, on the right track...


What would be the type attribute for the declared var design.. ie..


<MySource_DECLARE name="current_uri" value="%globals_server_REQUEST_URI%" type="globals" description="The current URI of the page"/>


It is a custom login design which overrides the default matrix login design, I had tried using the keyword replacement variable prior to starting this thread with no success, thus asking about how to use the print tag.

(Van Tran) #6

Thanks Bart,


I've figured out how to do this using the online manuals.


Thanks again!