codice:
<%
if Request.QueryString("flag")="" then
%>
<script language="JavaScript">
function Informazioni() {
var Divisione=navigator.userAgent;
var Parti=Divisione.substring(Divisione.indexOf('(')+1,Divisione.lastIndexOf(')'));
var Parti=Parti.split(';');
Larghezza=screen.width;
Altezza=screen.height;
Colori1=screen.colorDepth;
Colori2=Math.pow(2,Colori1);
SistemaOperativo=Parti[2];
LinguaOS=navigator.systemLanguage;
NomeBrowser=navigator.appName;
VersioneBrowser=Parti[1];
LinguaBrowser=navigator.userLanguage;
Proveider=Parti[3];
PaginaPrecedente=history.back();
Cpu=navigator.cpuClass;
location.href="index2.asp?cpu="+Cpu+"&altezza="+Altezza+"&larghezza="+Larghezza+"&Colori1="+Colori1+"&Colori2="+Colori2+"&so="+SistemaOperativo+"&los="+LinguaOS+"&nb="+NomeBrowser+"&vb="+VersioneBrowser+"&lb="+LinguaBrowser+"&Prov="+Proveider+"&PP="+PaginaPrecedente+"&flag=ok"
}
document.onload=Informazioni();
</script>
<%
end if
'Inizializzo le variabili necessarie
NomeFile=""
ValoreDB=0
Contatore=""
IP=""
Data=""
Ora=""
TipoOS=""
VideoX=""
VideoY=""
PaginaP=""
Browser=""
VersioneB=""
LinguaB=""
LinguaS=""
ColoreA=""
ColoreB=""
Prov=""
Processore=""
Randomize
Valore = int((4 * Rnd)+1)
NomeFile= "Tessuto" & Valore & ".gif"
'Assegno un valore alle variabili!
IP=Request.ServerVariables("REMOTE_ADDR")
Data=Date()
Ora=Time()
TipoOS=Request.querystring("so")
VideoX=Request.querystring("Larghezza")
VideoY=Request.querystring("altezza")
PaginaP=Request.querystring("PP")
Browser=Request.querystring("nb")
VersioneB=Request.querystring("vb")
LinguaB=Request.querystring("lb")
LinguaS=Request.querystring("los")
ColoreA=Request.querystring("colori1")
ColoreB=Request.querystring("colori2")
Prov=Request.querystring("Prov")
Processore=Request.querystring("cpu")
'Response.write(IP)
'Response.write(Data)
'Response.write(Ora)
'Response.write(TipoOS)
'Response.write(VideoX)
'Response.write(VideoY)
'Response.write(PaginaP)
'Response.write(Browser)
'Response.write(VersioneB)
'Response.write(LinguaB)
'Response.write(LinguaS)
'Response.write(ColoreA)
'Response.write(ColoreB)
'Response.write(Prov)
'Response.write(Processore)
'Response.end()
If Session("Counter")="" then 'devo controllare se nel db persiste il record con ID = 1
'apro la connessione con il db
set myConn = server.CreateObject("ADODB.Connection")
dim strConnDb
strConnDb = ""
strConnDb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = G:/Progetti Lavori/Web Project/Da Fare/Tessuti/tessuti1.mdb"
'strConnDb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & server.mappath("/mdb-database/tessuti1.mdb")
myConn.Open(strConnDb)
'Registro le informazioni recuperate dal sistema!
dim strSqlStatistiche
strSqlStatistiche = ""
strSqlStatistiche = "insert into Statistiche (IndirizzoIP,Data,Ora,Sistema,RisX,RisY,Provenienza,Browser,VersioneB,LBrowser,LinguaOS,Colori1,Colori2,Proveider,Cpu) values (':1:',':2:',':3:',':4:',':5:',':6:',':7:',':8:',':9:',':10:',':11:',':12:',':13:',':14:',':15:')"
strSqlStatistiche = replace(strSqlStatistiche,":1:",replace(cstr(IP),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":2:",replace(cstr(Data),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":3:",replace(cstr(Ora),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":4:",replace(cstr(TipoOS),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":5:",replace(cstr(VideoX),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":6:",replace(cstr(VideoY),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":7:",replace(cstr(PaginaP),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":8:",replace(cstr(Browser),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":9:",replace(cstr(VersioneB),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":10:",replace(cstr(LinguaB),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":11:",replace(cstr(LinguaS),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":12:",replace(cstr(ColoreA),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":13:",replace(cstr(ColoreB),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":14:",replace(cstr(Prov),"'","''",1,-1))
strSqlStatistiche = replace(strSqlStatistiche,":15:",replace(cstr(Processore),"'","''",1,-1))
myConn.Execute(strSqlStatistiche)
il porblema è legato alla registrazione delle variabili, infatti mentre con i response.write tutte le variabili asp assumono un valore appropiato quoando poi passa alla fase di registrazione vengono registrati nel db solo i primi 3 valori ossia Indirizzoip, data e ora, mentre le altre variaili no...