[sldev] New to the list with a complicated question.

Infinity Linden infinity at lindenlab.com
Tue Sep 29 14:23:09 PDT 2009


good comments all ...

in my copious spare time, i twist PHP to my will. you can detect if
someone is viewing the page with the in-world viewer with the
following PHP. (note. i don't claim to be a PHP expert, only that this
has worked for me in the past.)

what i do is to look at the request headers for the User-Agent header
and see if it contains the string "SecondLife". if it does, i know i'm
dealing with the SL viewer browser. if it doesn't i assume i'm dealing
with someone else's browser.

here's a sample page that illustrates grabbing headers from a request
and looking at the user agent:

<?php
$headers = getallheaders();

echo "<html><body><pre>";

if( ereg("SecondLife", $headers['User-Agent'] ) ) {
    echo "you are using	the second life viewer browser.\n";
} else {
  echo "you are	not using the second life viewer browser.\n";
}

echo "</pre></body></html>";
?>

hope this is of some use...

-cheers
-infinity


On Tue, Sep 29, 2009 at 12:32 PM, Mike Monkowski
<monkowsk at fishkill.ibm.com> wrote:
> See http://kb2.adobe.com/cps/140/tn_14086.html and links from there.
>
> Poppy Foxdale wrote:
>> Greetings everyone,
>>
>> I apologize in advance if this message seems muddled, I'm not sure how
>> to go about fielding my question. Torley pointed me in this direction as
>> I'm stepping into something that's a bit over my head. Since the
>> in-Viewer browser can't view things like Flash and some other content,
>> is it possible to code a website to pull up an alternative page? So if a
>> user views a page In-Viewer it pulls up the appropriate version of the
>> website? I know things like this can be done with iPhones and such. Id
>> like to do this with a page I'm in the process of building, but I've no
>> idea how to go about doing it or if it's possible. If anyone could nudge
>> me to the source of such information, I would greatly appreciate it.
>>
>> -Poppy
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Policies and (un)subscribe information available here:
>> http://wiki.secondlife.com/wiki/SLDev
>> Please read the policies before posting to keep unmoderated posting privileges
>
> _______________________________________________
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/SLDev
> Please read the policies before posting to keep unmoderated posting privileges
>


More information about the SLDev mailing list