View Single Post
  #5 (permalink)  
Old 2004-02-03, 06:59 AM
KhunJack KhunJack is offline
Junior Member
 
Join Date: Jan 2004
Posts: 4
KhunJack
Default

Zara,
thanks a lot .. mhh ..I wasn't aware about the get_browser command ..

Meanwhile I realized another solution.
My first page is having all the java scripts..I move them over to a second page which writes them to the database ..and hopp afterwards of my real "first page"... what you think about this solutions ..any comments?

Al the Best
Jack

------------------------------------
PAge 1..
------------------------------------
<HTML>
<?php
// File Location: /index.php
// Vistats Tracker Test
include("visitor_stats/visitor_stats.php");


require_once("elements.php");
require_once("class.visitors.php");

// iniate
$oVisitors = new visitors;

// ..is the Google Dance on ?
if (@ereg("Google", $agent)) {
$iVisitsCnt = $oVisitors->addGoogleDanced();
}

// Verify if user come from search engine, keep arec incl. search criterions
// this function should be tried to include into the handleVisitor function
// but for testing ... the PAge needs to be listed first
$iVisitsCnt = $oVisitors->addSearchKeywords();
?>
<HEAD>
</HEAD>
<script language="Javascript">
var agt=navigator.userAgent.toLowerCase();
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1));
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) ||
(agt.indexOf("; nav") != -1)) );
var is_nav5 = (is_nav && (is_major == 5));
var is_nav5up = (is_nav && (is_major >= 5));
var is_ie = (agt.indexOf("msie") != -1);
var is_ie3 = (is_ie && (is_major < 4));
var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
var is_aol = (agt.indexOf("aol") != -1);
var is_aol3 = (is_aol && is_ie3);
var is_aol4 = (is_aol && is_ie4);
var is_opera = (agt.indexOf("opera") != -1);
var is_webtv = (agt.indexOf("webtv") != -1);

if (is_nav4up) {
this.browser = "Netscape"; // netscape 4+ but not NS5
}else if (is_webtv) { // Web TV
this.browser = "Webtv";
}else if (is_aol || is_aol3 || is_aol4) { //AOL
this.browser = "AOL";
}else if (is_opera) { // Opera
this.browser = "Opera";
}else if (is_ie3||is_nav3) { // 3.0 version browsers
this.browser = "Version3Browser";
}else if (is_ie4up) { //IE4 & IE5 but returns IE4
this.browser = "Microsoft Internet Explorer";
}else if (is_nav5up) { // Netscape 5
this.browser = "Netscape";
}


sB=this.browser;
sSH=screen.height;
sSW=screen.width;
sAV=navigator.appVersion.substring(0,4);
sP=navigator.platform;
sJ=navigator.javaEnabled();
redi_str = "index2.php?sJ="+sJ+'&sB='+sB+'&sAV='+sAV+'&sSH='+ sSH+'&sSW='+sSW+'&sP='+sP;
location = redi_str;
//-->
</script>
</HTML>


------------------------------------
Page 2...
-------------------------------------
<?php
// File Location: /index2.php
// session start
session_start();
require_once("elements.php");
require_once("class.visitors.php");


if(isset($_GET['sJ'])) {
// count the vistors and store browser information!!!!!!!
// iniate ...should be on every page !!! ????
$oVisitors = new visitors;
// $_SESSION["visitor_info"];
session_register("visitor_info");
$aArgs["javaon"] = $_GET['sJ'];
$aArgs["platform"] = $_GET['sP'];
$aArgs["screenheight"] = $_GET['sSH'];
$aArgs["screenwidth"] = $_GET['sSW'];
$aArgs["browser"] = $_GET['sB'];
$aArgs["appVersion"] = $_GET['sAV'];
$aArgs["id"] = $visitor_info->home[id];
$visitor_info->home[id] = $oVisitors->handleVisitor($aArgs);
// Let's visit the pages
header("Location: /site/main/index.php");
} else {

print "Ohhhh No";
}

// und das eben mit allen varianten

?>
Reply With Quote