Click to See Complete Forum and Search --> : my browser detection


skool h8r
10-29-2004, 03:52 PM
hi all,
I need a script making so that it can only provide updates if a certain browser is accessing the updates page. The browser version is 4.0 (compatible; MSIE 6.0; Windows NT 5.1; Browsemaster v1.1) and the update page is http://www.freewebs.com/yowzagames-mark2/browsemaster/updates (this page hasn't been added yet because I need the script)

The updates will be shown as links in a html page. I need it so that only the browsemaster client can view the updates page, all versions of browsemaster from version 1.1 onwards. Can anyone provide a script that fits the description and tell me what to place where in the html document.(i.e. what part of the script should be placed in the head, body, etc.)

Thanks in advance,
regards,
Scott.

Jona
10-29-2004, 04:08 PM
You might consider a server-side solution for this -- does Freewebs support PHP scripting? The following goes in your HEAD tags.


<script type="text/javascript"><!--
if(navigator.appName.toLowerCase().indexOf("browsemaster") == -1){
location.href = "wrong_browser.html";
}
//--></script>

skool h8r
10-30-2004, 05:01 AM
Thankyou, that is just what i'm after, now it means that you can only receive updates if you actually downloaded, installed and are using browsemaster.
Kindest regards,
Scott.

P.S. freewebs doesn't support PHP.:(

EDIT: This script doesn't seem to work, i put it in the head area of 'updates.htm' and tried it in browsemaster but it just doesn't work. Maybe a different browser detection script is needed. e.g.


<script type='text/javascript'>
<!--
if (navigator.client=='Browsemaster' && 'v1.1' or above)-1;
location.href='updates.htm';
else
{
location.href='wrongbrowser.htm';
}
-->
</script>


I know that the above script isn't a proper javascript but i don't know how to code in javascript. I tried editing the script you gave me as well without any success, i need one that i can just place in the head tag of 'updates.htm' and let it detect what browser a person is using.People can still view it when they are in IE though, even if they aren't using browsemaster.i don't know how i should go about this. all scripts are welcome.
TIA,
scott.

notorius
10-30-2004, 08:53 AM
hey skool h8er u might want to use www.hostultra.com ,supports php,html,xhtml and more and everything for FREE!
my question was that when i visited a site using opera it didnt have any message on top of the header,but once when i used internet explorer to go to that site a message came on top of the header saying
'You are using internet explorer version 6,this site is best viewed with firefox or opera or it might appear buggy'

can anyone tell me how to do that?

skool h8r
10-30-2004, 08:57 AM
hmm, i'm not really sure how to do that, something like the above script but with 'document.write' maybe? i'm not really sure. Thanks for posting the link, i will have a look at that in a minute.
regards,
Scott.

Charles
10-30-2004, 09:05 AM
<script type="text/javascript">
<!--
if (navigator.appName == 'Microsoft Internet Explorer' && /MSIE (\d+)/.test (navigator.appVersion)) document.write('<p>Pheew! You are using Internet Explorer version ', RegExp.$1 , ', this site is best viewed with <a href="http://www.mozilla.org/">Firefox</a> or <a href="http://www.opera.com/">Opera</a> or it might appear buggy.</p>')
// -->
</script>