<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[I dati non esistono nel db]]></title><description><![CDATA[<p dir="auto">Salve, ho scritto la pagina login. con alcune delle mie funzioni.<br />
Ma volevo solo sapere come faccio ad dirgli se non esiste quell'email o password dentro il db far venire fuori un messaggio del tipo "Non esistono" Mi dite come fare?.</p>
<p dir="auto">grazie.</p>
<p dir="auto">ecco il codice:</p>
<pre><code class="language-html">&lt;!-- #include virtual="/inc.asp" --&gt;
&lt;!-- #include virtual="/header.asp" --&gt;
&lt;%


function TestCaptcha(byval valSession, byval valCaptcha)
    dim tmpSession
    valSession = Trim(valSession)
    valCaptcha = Trim(valCaptcha)
    if (valSession = vbNullString) or (valCaptcha = vbNullString) then
        TestCaptcha = false
    else
        tmpSession = valSession
        valSession = Trim(Session(valSession))
        Session(tmpSession) = vbNullString
        if valSession = vbNullString then
            TestCaptcha = false
        else
            valCaptcha = Replace(valCaptcha,"i","I")
            if StrComp(valSession,valCaptcha,1) = 0 then
                TestCaptcha = true
            else
                TestCaptcha = false
            end if
        end if        
    end if
end function
%&gt;&lt;%

action = Request.Form("act")
email=Request.Form("email") 
loginpassword=Request.Form("password") 

%&gt;
&lt;%
errore = ""
if action ="entra" then
if email = "" then
errore = errore &amp; "Non hai inserito l'email"
elseif loginpassword = "" then
errore = errore &amp; "Non hai inserito la password"

    Elseif not IsEmpty(Request.Form("invia")) then
        
        if TestCaptcha("ASPCAPTCHA", Request.Form("captchacode")) then
        
'errore = errore &amp; "Devi inserire password per modificare i dati"
SQL = "SELECT * FROM users WHERE email =  '" &amp; email &amp; "' and  passwords =  '" &amp; loginpassword &amp; "' and locks='2';"
Set oRs = Mysql_Rows(oCn,SQL)

if not oRs.eof then
    
 
 SQL = "SELECT * FROM users WHERE email =  '" &amp; email &amp; "' and  passwords =  '" &amp; loginpassword &amp; "' and locks='2';"

 Set RS = MySql_Rows(oCn, SQL)


    if not RS.eof then
    RS.movefirst
    Do
        loginsuccess = "1"
        UsersId = RS("UsersId")
        UId = RS("UsersId")
        nick = RS("nick")
        role = RS("role")
        level = RS("levels")
        Pass= RS("passwords")
        Email = RS("email")
        RS.movenext
    Loop until RS.eof
    RS.movefirst
    End if


    if   loginsuccess = "1"   then




    Response.Cookies("uId")("uIds") = UsersId
    Response.Cookies("UId")("UId") = UId
    Response.Cookies("username")("Nick") = nick
    Response.Cookies("role")("roles") = role
    Response.Cookies("level")("levels") = level
    Response.Cookies("email")("emails") = Email
    Response.Cookies("Password_current")("Pass")= Pass

    SQL = ""
    SQL = SQL &amp; "INSERT INTO users_online(nick)VALUES("
    SQL = SQL &amp; "'"&amp;nick&amp;"')"
    Mysql_Query oCn,SQL
    erorre = errore  &amp; "Redirect in corso"
    Response.Write("&lt;meta http-equiv='refresh' content='4;URL="&amp;strUrl&amp;"'")
    
    End if
    else
    errore = errore &amp; "Spiacente la tua password non coincide con il tuo username"

    End if
    else
    errore = errore &amp; "Non hai inserito il codice essato"
    End if
    
    
    else
    End if
    else

    %&gt;    
&lt;form method="POST" action="login.asp" name="login"&gt;
&lt;p&gt;&lt;%=errore%&gt;&lt;/p&gt;
&lt;input type="hidden" name="act" value="entra"&gt;

    &lt;div class="right"&gt;
             &lt;p&gt;&amp;nbsp;&lt;/p&gt;
             &lt;table width="100%" border="0" cellspacing="2" cellpadding="2"&gt;
               &lt;tr&gt;
                 &lt;td colspan="2"&gt;Benvenuto nell'area riservata se non ti sei ancora registrati vai in questa pagina (&lt;a href="registrati.asp" class="a"&gt;registrati&lt;/a&gt;) e riempi il modulo&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td width="25%"&gt;&amp;nbsp;&lt;/td&gt;
                 &lt;td width="75%"&gt;&amp;nbsp;&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td&gt;&lt;label for="name2"&gt;Email:&lt;/label&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;input type="text" name="email" value="&lt;%=email%&gt;" /&gt;&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td&gt;&lt;label for="name3"&gt;Password:&lt;/label&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;input type="text" name="password" value="&lt;%=loginpassword%&gt;" /&gt;&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td height="35"&gt;&amp;nbsp;&lt;/td&gt;
                 &lt;td&gt;&amp;nbsp;&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td&gt;Codice di sicurezza&lt;/td&gt;
                 &lt;td&gt;&lt;img src="/captcha.asp" alt="" id="imgCaptcha" /&gt;&lt;br /&gt;
                   &lt;a href="javascript:void(0)" onclick="RefreshImage('imgCaptcha')" style="color:#000000;"&gt;Change Image&lt;/a&gt;&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td&gt;Inserire codice sicurezza&lt;/td&gt;
                 &lt;td&gt;&lt;input name="captchacode" type="text" id="captchacode" size="10" /&gt;&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                 &lt;td&gt;&lt;input type="submit" name="invia" value="Accedi" /&gt;&lt;/td&gt;
               &lt;/tr&gt;
          &lt;/table&gt;
             &lt;p&gt;&amp;nbsp;&lt;/p&gt;
    &lt;/div&gt;
&lt;/form&gt; 

&lt;%     End if %&gt;
&lt;%=errore%&gt;
&lt;!-- #include virtual="/footer.asp" --&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/topic/102521/i-dati-non-esistono-nel-db</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 14:26:37 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/102521.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 May 2009 13:23:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I dati non esistono nel db on Sat, 30 May 2009 15:57:28 GMT]]></title><description><![CDATA[<p dir="auto">Grazie mille, ha funzionato.</p>
<p dir="auto">ti ringrazio molto.</p>
]]></description><link>https://dev.connect.gt/post/834033</link><guid isPermaLink="true">https://dev.connect.gt/post/834033</guid><dc:creator><![CDATA[terra]]></dc:creator><pubDate>Sat, 30 May 2009 15:57:28 GMT</pubDate></item><item><title><![CDATA[Reply to I dati non esistono nel db on Sat, 30 May 2009 15:21:18 GMT]]></title><description><![CDATA[<p dir="auto">prima della riga "if not rs.eof"...metti una riga "if rs.eof"...</p>
<p dir="auto">Mentre la prima condizione gli dice che se non è alla fine del file (eof=end of file), e quindi vuol dire che ha trovato un record dove corrispondono username e password inseriti, nella condizione if rs.eof gli dici di restituire il messaggio che indica di non aver trovato record corrispondenti....quindi potresti mettere qualcosa tipo:</p>
<p dir="auto">if rs.eof then response.write "Attenzione! Non esistono Username e Password inseriti!"</p>
<p dir="auto">poi sistemalo tu che vedo che assegni il valore della variabile errore, e poi la stampi in base al caso...</p>
<p dir="auto">Ciao</p>
]]></description><link>https://dev.connect.gt/post/834021</link><guid isPermaLink="true">https://dev.connect.gt/post/834021</guid><dc:creator><![CDATA[ale.1976]]></dc:creator><pubDate>Sat, 30 May 2009 15:21:18 GMT</pubDate></item><item><title><![CDATA[Reply to I dati non esistono nel db on Fri, 29 May 2009 14:50:16 GMT]]></title><description><![CDATA[<p dir="auto">ho sistemato la parte della pagina (login).<br />
ecco il codice:</p>
<pre><code class="language-html">&lt;!-- #include virtual="/inc.asp" --&gt;
&lt;!-- #include virtual="/header.asp" --&gt;
&lt;%


function TestCaptcha(byval valSession, byval valCaptcha)
    dim tmpSession
    valSession = Trim(valSession)
    valCaptcha = Trim(valCaptcha)
    if (valSession = vbNullString) or (valCaptcha = vbNullString) then
        TestCaptcha = false
    else
        tmpSession = valSession
        valSession = Trim(Session(valSession))
        Session(tmpSession) = vbNullString
        if valSession = vbNullString then
            TestCaptcha = false
        else
            valCaptcha = Replace(valCaptcha,"i","I")
            if StrComp(valSession,valCaptcha,1) = 0 then
                TestCaptcha = true
            else
                TestCaptcha = false
            end if
        end if        
    end if
end function


action = Request.Form("act")
email=Request.Form("email") 
loginpassword=Request.Form("password") 


if action ="entra" then
if email = "" then
errore = errore &amp; "&lt;p style='background-color:red;font-size:20px;'&gt;Non hai inserito l'email&lt;/p&gt;"
elseif loginpassword = "" then
errore = errore &amp; "&lt;p style='background-color:red;font-size:20px;'&gt;Non hai inserito la password&lt;/p&gt;"


    Elseif not IsEmpty(Request.Form("invia")) then
        
        if TestCaptcha("ASPCAPTCHA", Request.Form("captchacode")) then
        
     
    
 
 SQL = "SELECT * FROM users WHERE email =  '" &amp; email &amp; "' and  passwords =  '" &amp; loginpassword &amp; "' and locks='2';"

 Set RS = MySql_Rows(oCn, SQL)


    if not RS.eof then
    RS.movefirst
    Do
        loginsuccess = "1"
        UsersId = RS("UsersId")
        UId = RS("UsersId")
        nick = RS("nick")
        role = RS("role")
        level = RS("levels")
        Pass= RS("passwords")
        Email = RS("email")
        RS.movenext
    Loop until RS.eof
    RS.movefirst
    else
    erorre = errore &amp; "&lt;p style='background-color:green;font-size:20px;'&gt;Nessuna Password o email nel db&lt;/p&gt;"

    End if


    if   loginsuccess = "1"   then




    Response.Cookies("uId")("uIds") = UsersId
    Response.Cookies("UId")("UId") = UId
    Response.Cookies("username")("Nick") = nick
    Response.Cookies("role")("roles") = role
    Response.Cookies("level")("levels") = level
    Response.Cookies("email")("emails") = Email
    Response.Cookies("Password_current")("Pass")= Pass

    SQL = ""
    SQL = SQL &amp; "INSERT INTO users_online(nick)VALUES("
    SQL = SQL &amp; "'"&amp;nick&amp;"')"
    Mysql_Query oCn,SQL
    erorre = errore  &amp; "Redirect in corso"
'    Response.Write("&lt;meta http-equiv='refresh' content='4;URL="&amp;strUrl&amp;"'")
      
    End if
      
      Response.Redirect("registrato.asp")
else
            errore = errore &amp; "&lt;p style='background-color:red;font-size:20px;text-align:center;'&gt;Errore codice non in uso&lt;/p&gt;"
        end if
    
    end if

End if




%&gt;
&lt;div style="margin-left:10px;"&gt;
&lt;form method="POST" action="&lt;%=strUrl%&gt;" &gt;
&lt;p&gt;&lt;%=strUrl%&gt;&lt;/p&gt;

&lt;p&gt;&lt;input type="hidden" name="act" value="entra"&gt;&lt;/p&gt;


&lt;table width="100%" border="0" cellspacing="4" cellpadding="4"&gt;
  &lt;tr&gt;
    &lt;td colspan="2" align="center" valign="middle" &gt;Benvenuto nell'area riservata se non ti sei ancora registrati vai in questa pagina (&lt;a href="registrati.asp" class="a"&gt;registrati&lt;/a&gt;) e riempi il modulo&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td colspan="2"&gt;Errore:
      &lt;% Response.Write(errore) %&gt;
   &lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="39%"&gt;Insrire l'email per entrare&lt;/td&gt;
    &lt;td width="61%"&gt;&lt;input type="text" name="email" value="&lt;%=email%&gt;" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Inserire la password per entrare&lt;/td&gt;
    &lt;td&gt;&lt;input type="text" name="password" value="&lt;%=password%&gt;" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Codice di sicurezza&lt;/td&gt;
    &lt;td&gt;&lt;img src="/captcha.asp" alt="" id="imgCaptcha" /&gt;&lt;br /&gt;
      &lt;a href="javascript:void(0)" onclick="RefreshImage('imgCaptcha')" style="color:#000000;"&gt;Change Image&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Inserire codice sicurezza&lt;/td&gt;
    &lt;td&gt;&lt;input name="captchacode" type="text" id="captchacode" size="10" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&lt;input type="submit" name="invia" value="Accedi!" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;/form&gt;
&lt;/div&gt;

&lt;!-- #include virtual="/footer.asp" --&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/834031</link><guid isPermaLink="true">https://dev.connect.gt/post/834031</guid><dc:creator><![CDATA[terra]]></dc:creator><pubDate>Fri, 29 May 2009 14:50:16 GMT</pubDate></item></channel></rss>