Wednesday, May 25, 2011

PHP Proxy for QlikView sever

It is quite counter-intuitive that the server-settings for QVS have to be configured in Internet Explorer's settings page, using the same account that is used to run QVS service. Not to mention that whenever the account decides to configure itself as "roaming profile", or the domain policy for Internet explorer is changed, or .. the settings are lost = maps don't work.

Here is another way , where there is a local Apache web server running PHP and acting getting the Google maps thry the same proxy that is configured in Internet Explorer. It uses Windows authentication for the proxy server.

Probaly you can write the equivalent in other webserver (ex IIS ) and other programming language .

$usr = 'user:password';

$proxy = '10.11.12.13:8080';

//force header to JPEG

header("Content-type: image/jpeg\n\n");

//same GET parameters as with Google Maps

$url = 'http://maps.google.com/staticmap?center=' . $_GET['center'] .

'&zoom=' . $_GET['zoom'] .

'&maptype=' . $_GET['maptype'] .

'&size=' . $_GET['size'] .

'&key=' . $_GET['key'];

// create a new cURL resource

$ch = curl_init();

// set URL and other appropriate options

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_HEADER, 0);

//curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);

curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);

curl_setopt($ch, CURLOPT_PROXY, $proxy);

curl_setopt($ch, CURLOPT_PROXYUSERPWD, $usr);

// grab URL and pass it to the browser

curl_exec($ch);

// close cURL resource, and free up system resources

curl_close($ch);

?>

1 comment:

Unknown said...

Definitely, what a fantastic blog and revealing posts, I surely will bookmark your site.All the Best!
QlikView Expression Language / UI interview Questions

1.Explain Aggr Function?
2.What is the use of FirstSortValue in QlikView?
3.What are Set Modifiers and Set Identifiers?
4.What is P() & E() and where do you use them?
5.What is the difference between ValueList() and ValueLoop()?
6.What is Partial Reload? and why do you use “ONLY” Qualifier?
7. What is the difference between Cyclic Group & Drilldown Group?
thanks.qlikview training in hyderabad