Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
  1. La community italiana di SEO, marketing digitale e AI
  2. Categorie
  3. Coding e Sistemistica
  4. Coding
  5. Funzioni per verifica validità carte di credito

Funzioni per verifica validità carte di credito

Pianificato Fissato Bloccato Spostato Coding
1 Post 1 Autori 1.9k Visualizzazioni 1 Seguito
  • Da Vecchi a Nuovi
  • Da Nuovi a Vecchi
  • Più Voti
Rispondi
  • Risposta alla discussione
Effettua l'accesso per rispondere
Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
  • G
    G
    guidoc
    scritto su ultima modifica di
    User Newbie 0
    #1
    Funzioni per verifica validità carte di credito

    Ciao a tutti, nel norum ho trovato i seguemti scripts. qualcuno mi sa dire come applicarli?

    io ho una pagina con un modulo ed ho i seguenti campi:

    • Tipo carta = cctype
    • Numero Carta = ccnumber
    • Cod. di Controllo = cvc_code

    l'ho messo on-line ma credo che non ha i controlli dovuti, ovvero non da il minimo avviso. cosa sbaglio?

    <%
    Function ValidCcNumber(ccnumber)
    ccnumber = cleanccnum(ccnumber)
    If ccnumber = "" then
    validccnumber = false
    Else
    iseven = false
    digits = ""
    For i = len(ccnumber) to 1 step -1
    If iseven then
    digits = digits & cint(mid(ccnumber, i, 1))*2
    Else
    digits = digits & cint(mid(ccnumber,i,1))
    End if
    iseven= (not iseven)
    Next
    checksum = 0
    For i = 1 to len(digits) Step 1
    checksum = checksum + cint(mid(digits, i, 1))
    Next
    validccnumber = ((checksum mod 10)=0)
    End if
    End function
    %>
    <%
    Function ValidCcType(ccnumber,cctype)
    ValidCcType = true
    If cctype = "Visa" then
    If CInt(cleanccnum(Left(ccnumber,1))) <> 4 then ValidCcType = false
    Elseif cctype = "MasterCard" then
    If not (CInt(cleanccnum(Left(ccnumber,2))) > 50 and CInt(cleanccnum(Left(ccnumber,2))) < 56) then ValidCcType = false

    Elseif cctype = "AmericanExpress" then
        If not CInt(cleanccnum(Left(ccnumber,2))) = 34 and not CInt(cleanccnum(Left(ccnumber,2))) = 37 then ValidCcType = false
    Elseif cctype = "DinersClubCarteBlanche" then
        If not (CInt(cleanccnum(Left(ccnumber,3))) > 299 and CInt(cleanccnum(Left(ccnumber,3))) < 306) and not CInt(cleanccnum(Left(ccnumber,2))) = 37 and not CInt(cleanccnum(Left(ccnumber,2))) = 36 and not CInt(cleanccnum(Left(ccnumber,2))) = 38 then ValidCcType = false
    Elseif cctype = "Discover" then
        If not CInt(cleanccnum(Left(ccnumber,2))) = 6011 then ValidCcType = false
    End if
    

    End function
    %>
    <%
    Function ValidCcLength(ccnumber,cctype)
    ValidCcLength = true
    If cctype = "Visa" then
    If Len(ccnumber) <> 16 and Len(ccnumber) <> 13 then ValidCcLength = false
    Elseif cctype = "MasterCard" then
    If Len(ccnumber) <> 16 then ValidCcLength = false
    Elseif cctype = "AmericanExpress" then
    If Len(ccnumber) <> 15 then ValidCcLength = false
    Elseif cctype = "DinersClubCarteBlanche" then
    If Len(ccnumber) <> 14 then ValidCcLength = false
    Elseif cctype = "Discover" then
    If Len(ccnumber) <> 16 then ValidCcLength = false
    End if
    End function
    %>
    <%
    Function ValidCvcLength(cvc_code,cctype)
    ValidCvcLength = true
    If cctype = "Visa" then
    If Len(cvc_code) <> 3 then ValidCvcLength = false
    Elseif cctype = "MasterCard" then
    If Len(cvc_code) <> 3 then ValidCvcLength = false
    Elseif cctype = "AmericanExpress" then
    If Len(cvc_code) <> 4 then ValidCvcLength = false
    Elseif cctype = "DinersClubCarteBlanche" then
    If Len(cvc_code) <> 3 then ValidCvcLength = false
    Elseif cctype = "Discover" then
    If Len(cvc_code) <> 3 then ValidCvcLength = false
    End if
    End function
    %>
    <%
    Function cleanccnum(ccnumber)
    For i = 1 to len(ccnumber)
    If isnumeric (mid(ccnumber, i, 1)) then
    cleanccnum = cleanccnum & mid(ccnumber, i,1)
    End if
    Next
    End function
    %>

    Grazie

    1 Risposta Ultima Risposta
    Miglior risposta 0
    0

    Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.

    Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.

    Con il tuo contributo, questo post potrebbe essere ancora migliore 💗

    Registrati Accedi
    Rispondi
    • Risposta alla discussione
    Effettua l'accesso per rispondere
    • Da Vecchi a Nuovi
    • Da Nuovi a Vecchi
    • Più Voti


    • Accedi

    • Non hai un account? Registrati

    • Accedi o registrati per effettuare la ricerca.
    • Primo post
      Ultimo post
    Home Accedi Registrati
    Menu
    • CATEGORIES
    • La Community Connect.gt
    • Presentati alla Community
    • News Ufficiali da Connect.gt
    • Internet News
    • A Scuola Di
    • Digital Marketing
    • Intelligenza Artificiale
    • SEO & GEO
    • Web Marketing e Content
    • Google Analytics e Web Analytics
    • Google Ads & Advertising
    • YouTube
    • TikTok, Instagram e altri Social
    • Google Adsense, Affiliazioni e Guadagno
    • E-Commerce
    • Coding e Sistemistica
    • Help Center: consigli per il tuo progetto
    • Hosting e Cloud
    • Coding
    • CMS & Piattaforme Self-Hosted
    • Annunci e Collaborazioni
    • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
    • Collaborazioni WEB e Lavoro: offro e cerco
    • Impresa, Fisco e Leggi
    • Consulenza Legale e Professioni Web
    • Consulenza Fiscale, Imprese, Startup e P.Iva
    • Gli Off Topic
    • PC, Smartphone e altri Hardware
    • Tutti i Software
    • GT Fetish Cafè
    • Discussioni
    • Non letti 0
    • Recenti
    • Hashtag
    • Popolare
    • Utenti
    • Privacy
    • Termini e condizioni
    • © 2026 Search On Media Group S.r.l.