niente...non riesco...
la mia pagina asp(solo per il controllo dello user che in questo caso è il campo email perchè coincidono)
codice:
<%
dim email
email=Request.form("email_txt")
Dim Conn
Dim Rs
Dim SQL
case1="ok"
case2="1"
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("/mdb-database/Dati.mdb")
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * from myTable where Email='" & email & "'"
rs.open SQL, Conn, 1, 3
if not Rs.eof then
Response.Write "result="&case1&"&"
else
Response.Write "result="&case2&"&"
End if
Rs.close
conn.close
set Rs=nothing
set conn=nothing
%>
e quello che mi restituisce è result=1&
il mio form funziona...per modo di dire con questo codice
codice:
Selection.setFocus("nome_txt");
Selection.setSelection(psw_reg_txt, nome_txt);
function controllo() {
now = getTimer();
function checkEmail(email_txt:String):Boolean {
if (email_txt.indexOf(" ")>0) {
return false;
}
var emailArray:Array=email_txt.split("@");
if (emailArray.length != 2 || emailArray[0].length == 0 || emailArray[1].length ==0) {
return false;
}
var postArray:Array=emailArray[1].split(".");
if (postArray.length < 2) {
return false;
}
for (var i:Number=0; i<postArray.length; i++) {
if (postArray[i].length < 1) {
return false;
}
}
var suffix=postArray[postArray.length-1];
if (suffix.length < 2 || suffix.length > 3) {
return false;
}
return true;
}
if (email_txt.length > 0) {
if (checkEmail(email_txt)) {
valemail_txt = true;
} else {
valemail_txt = false;
}
}
var myLV:LoadVars = new LoadVars();
myLV.email_txt = email_txt.text;
myLV.sendAndLoad("checkmail.asp", myLV, "POST");
myLV.onLoad = function (ok) {
if(ok) {
if(myLV.result == "ok") {
return true;
} else {
return false;
}
}
}
if (ok(email_txt)){
valemailexist = true;
} else {
valemailexist = false;
}
if (conf_email_txt == email_txt) {
valconf_email_txt = true;
} else {
valconf_email_txt = false;
}
if (psw_reg_txt.length > 2) {
valpsw_reg_txt = true;
} else {
valpsw_reg_txt = false;
}
if (conf_psw_reg_txt == psw_reg_txt) {
valconf_psw_reg_txt = true;
} else {
valconf_psw_reg_txt = false;
}
if (valemail_txt & valpsw_reg_txt & valconf_psw_reg_txt & valconf_email_txt & valemailexist ) {
loadVariablesNum("http://www.miosito.it/prova/contact.asp", 0, "POST");
_root.play();
_root.testoasp.text=this.testo;
_root.testoasp.play();
} else {
errore();
}
}
function errore() {
if (!valemail_txt) {
_root.out = "Inserire una email valida";
Selection.setFocus("email_txt");
}
if (!valpsw_reg_txt) {
_root.out = "Inserire una psw valida";
Selection.setFocus("psw_reg_txt");
}
if (!valconf_psw_reg_txt) {
_root.out = "i campi psw e confpsw no";
Selection.setFocus("conf_psw_reg_txt");
}
if (!valconf_email_txt) {
_root.out = "i campi email e confemail no";
Selection.setFocus("conf_email_txt");
}
if (!valemailexist) {
_root.out = "Lo user risulta essere gia esistente";
Selection.setFocus("email_txt");
}
}
in rosso quello che ho aggiunto per il controllo sull'esistenza dell'email in database
attendo gentili suggerimenti
grazie ancora!