function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jduhlsjduhls 

PHP Toolkit hijacks http_user_agent

Soon after I began using the PHP toolkit/soapclient 11.0b, the Apache global env. "http_user_agent" was hijacked to read:

Salesforce/PHPToolkit/1.0

Anyone else experience this?  Any ideas on a fix?
werewolfwerewolf
What problem is it causing for you?
jduhlsjduhls
When being contacted by users from webpage forms or running website statistics, this variable tells me OS and browser.  It is very important data for a web developer.

I should also specify server info: WAMP


Message Edited by jduhls on 07-07-2008 07:47 AM
Colin LoretzColin Loretz
I've run into a similiar situation however the issues I have with it are a little more urgent.

We have some custom salesforce functionality built into our content management system and whenever it uses the php toolkit, it hijacks the "http_user_agent" variable and changes it to "Salesforce/PHPToolkit/1.0".

This is a big issue for us because FCKeditor checks this variable in order to determine what browser the visitor is using. Because of this, the FCKeditor fails to load.

Is there any workaround for this?

Thanks,
Colin

Dawson1323Dawson1323
I just found a way around this in php.

Before the connection to salesforce is made, create a temp variable that equals http_user_agent ($temp_user_agent = $_SERVER['HTTP_USER_AGENT'])

Then after the connection (and in my case I added this after my entire sf code) set http_user_agent to the temp variable ($_SERVER['HTTP_USER_AGENT'] = $temp_user_agent).

This worked perfect for me! Hope that helps.

-Dawson