in reply to Extract form fields & values from query string of http_referrer
I've used the following SSI code (the Apache 2.0 mod_include documentation is a good read) for extracting cookies and turning them into query-strings which may or may not help you:
<!--#if expr='$HTTP_COOKIE = /query=([^;]+)/' --> <!--#set var='queryval' value='$1' --> <!--#elif expr='$QUERY_STRING = /query=([^\x26]+)/' --> <!--#set var='queryval' value='$1' --> <!--#else --> <!--#set var='queryval' value='' --> <!--#endif --> <!--#include virtual="/cgi-bin/search_script.pl?query=$queryval" -->
Some notes on the above. This code hunts for a cookie named "query". If it exists it sets an environment variable called "queryval" with the contents of that cookie. Otherwise it looks for the "query" parameter in the query string (passed by the HTTP GET). If it finds it then the environment variable "queryval" gets set. Otherwise "queryval" is set to nothing.
Oh, and \x26 is an ampersand (&). I escaped this character for my own personal reasons (you can just replace it with & if you prefer).
I know what I've provided is a bit more convoluted but is this along the lines of what you're trying to find out?
|
|---|