David LeBow
11-15-2008, 05:27 AM
And I thought that I was trying something simple...
I have a little plugin, short and stout:
$Rotatordata = file_get_contents('http://www.MySite.Com/Rotator.asp');
The output of the asp page gets inserted in the header template like this:
$Rotatordata
It's some custom ad rotator logic. Works like a charm. Then I thought I'd get clever and query the HTTP User Agent within the ASP's VBScript, something like this:
sAgent = Request.ServerVariables ("HTTP_USER_AGENT")
I'd like to disregard requests from web crawlers. If I request Rotator.asp from the browser, everything's fine. Once I embed it as shown above into the PHP Scripting and template in vBulletin, sAgent always returns an empty string.
Googling, I stumbled on this, but don't know to what extent it's true:
"file("yoururl"); will read the page and send an empty UA [User Agent] by default, this is sometimes done to filter your page, remove javascript, flash or java."
I expect that file and file_get_contents act in a similar way in this regard (?).
My question: is there any way to get at the user agent within the asp within the plugin called by PHP script within the VBulletin template?
Thanks in advance for any input.
I have a little plugin, short and stout:
$Rotatordata = file_get_contents('http://www.MySite.Com/Rotator.asp');
The output of the asp page gets inserted in the header template like this:
$Rotatordata
It's some custom ad rotator logic. Works like a charm. Then I thought I'd get clever and query the HTTP User Agent within the ASP's VBScript, something like this:
sAgent = Request.ServerVariables ("HTTP_USER_AGENT")
I'd like to disregard requests from web crawlers. If I request Rotator.asp from the browser, everything's fine. Once I embed it as shown above into the PHP Scripting and template in vBulletin, sAgent always returns an empty string.
Googling, I stumbled on this, but don't know to what extent it's true:
"file("yoururl"); will read the page and send an empty UA [User Agent] by default, this is sometimes done to filter your page, remove javascript, flash or java."
I expect that file and file_get_contents act in a similar way in this regard (?).
My question: is there any way to get at the user agent within the asp within the plugin called by PHP script within the VBulletin template?
Thanks in advance for any input.