Displaying environment variables (noob)


(Andrew Harris) #1

Still very much a newb to MSM, but learning as I go.
I'm migrating a site where I've previously used apache SSI's to populate a form field on a helpdesk request form.

eg: <!–#echo var="HTTP_USER_AGENT" -->

how can I do this in matrix?


(Andrew Harris) #2

ahem - many people have looked at this post, but no-one has replied.


Is this not possible in Matrix? I had hoped it would be trivial.


(Avi Miller) #3

We don't expose Apache or PHP's server variables within Matrix. You'd have to submit a feature request for this. I suspect the simplest way would be to create global keywords for the $_SERVER array.


(Andrei Railean) #4

You might explore the wonders of JavaScript - it knows the user agent.


http://www.quirksmode.org/js/detect.html


(Andrew Harris) #5

[quote]You might explore the wonders of JavaScript - it knows the user agent.
[right][post=“11789”]<{POST_SNAPBACK}>[/post][/right][/quote]

oh yeah, it’s always a fallback, but IMHO server side is always better.



why should I send a whole bunch of if statements in a script when the server already knows what I need



… a bit disappointing


(Avi Miller) #6

[quote]… a bit disappointing
[right][post=“11794”]<{POST_SNAPBACK}>[/post][/right][/quote]



Feel free to submit it as a feature request via our bug tracker at http://bugs.matrix.squiz.ne. :slight_smile:


(Andrei Railean) #7

If you submit a feature request today, and you assume that we jump in and develop this new feature right away, it will only be released with the next stable feature release, which will be 3.12, (3.10 has been released only 2 months ago). We do not put features in to the stable versions, only bug fixes and other improvements.


So your choice is to submit a feature request and wait, or use JavaScript and have it working today.