Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it L'avatar di kikysc
    Registrato dal
    Sep 2005
    Messaggi
    93

    mailinglist a 4 campi!!!

    Ciao ragazzi,
    ho bisogno di un piccolo aiuto, purtroppo non so programmare in asp, ma come tutti i buoni principianti studio il più possibile templete ed esempi completi.
    Vorrei realizzare una mailing list che mi permetta di acquisire 4 semplici dati per la registrazione nome/cognome/città/e-mail ovviamente tutti dati obbligatori e che i miei dati possano essere annidati in un banale file di testo o access...! Sapete aiutarmi?
    Grazie

  2. #2
    Utente di HTML.it L'avatar di kikysc
    Registrato dal
    Sep 2005
    Messaggi
    93

    scusate!!!

    Scusate....emmm non so programmare in PHP!!! Non che l'asp mi sia più noto!!!

  3. #3

  4. #4
    Utente di HTML.it L'avatar di kikysc
    Registrato dal
    Sep 2005
    Messaggi
    93

    non và!

    Ho trovato la mailinglist in questo sito http://asp.html.it/script/vedi/1003/offer-a-newsletter/ e ho provveduto ad apportare le modifiche dovute al codice ma una volta pubblicato online non trova la pagina quando si clicca su invia, potete aiutarmi?
    Vi posto il codice del file subscribe.asp:


    <%@ LANGUAGE="VBScript" %>
    <%Option Explicit%>
    <html>
    <head>

    <link href="../CRA.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <span class="pulsantiBIG">
    <%
    Dim con, rs, strSql

    If Request.Form("cmdSubmit") <> "" Then
    'The user has submitted the page, so process the Newsletter subscription request

    'Connect to the database
    Set con = GetDBConnection()

    'Verify that the email address does not already exist in the database
    strSql = "SELECT Email FROM Subscribers WHERE Email = '" + Request.Form("txtEmail") + "'"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open strSql, con, 1, 2

    If rs.EOF Then
    'The email address does not already exist, so add it
    rs.AddNew()
    rs("Email") = Request.Form("txtEmail")
    rs("Nome") = Request.Form("Nome")
    rs("Cognome") = Request.Form("Cognome")
    rs("ente") = Request.Form("Ente")
    rs.Update()

    'The email address has been added, show confirmation.

    'MODIFY the text below is displayed when an email is added to the newsletter
    %>
    Complimenti, la registrazione alla mailinglist è stata effettuata correttamente
    <%

    Else
    'The email address already exists in the database

    'MODIFY the text below is displayed when a person tries to enter the same email address
    ' a second time.
    %>
    Questa e-mail è stata già utilizzata
    <%

    End If

    'Clean up database objects
    rs.Close()
    Set rs = Nothing
    con.Close()
    Set con = Nothing

    Else

    'MODIFY the text below is displayed when the page is first loaded.
    %>
    </span>
    <form action="subscribe.asp" method="post">

    <div align="center" class="gray"> Nome:
    <input name="Nome" type="text" id="Nome" value="">
    Cognome:
    <input name="Cognome" type="text" id="Cognome" value="">



    Ente appartenenza:
    <input name="Ente" type="text" id="Ente" value="">



    E-mail:<input type="text" name="txtEmail" value="">


    <input type="submit" name="cmdSubmit" value="Invia">
    </div>
    </form>
    <%
    End If
    %>
    </body>
    </html>

    Vi posto il codice del file send.asp:
    <%@ LANGUAGE="VBScript" %>
    <%Option Explicit%>
    <html>
    <head>

    </head>
    <body>

    <%
    Dim con, rs, strSql, objMail

    If Request.Form("cmdSubmit") <> "" Then
    'The user has submitted the page, so process the Newsletter subscription request

    'Connect to the database
    Set con = GetDBConnection()

    'Get all email addresses in the database
    strSql = "SELECT Email FROM Subscribers"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open strSql, con, 1, 2

    If rs.EOF Then

    'MODIFY the text below displays when no subscribers exist
    %>
    There are no subscribers to the newsletter.
    <%
    'Clean up database objects
    rs.Close()
    Set rs = Nothing
    con.Close()
    Set con = Nothing

    Response.End
    End If

    While Not(rs.EOF)
    Set objMail = Server.CreateObject("CDONTS.NewMail")

    'MODIFY the following email address will appear as the from address for the email.
    objMail.From = "mymail@mymail.it"
    objMail.To = rs("Email")
    objMail.Body = Request.Form("txtEmail")

    objMail.Send

    rs.MoveNext()
    Wend

    'MODIFY the text below displays when all the emails have been sent
    %>
    The emails have been sent.
    <%

    'Clean up database objects
    rs.Close()
    Set rs = Nothing
    con.Close()
    Set con = Nothing

    Else

    'MODIFY the text below is displayed when the page is first loaded.
    %>
    <form action="send.asp" method="post" id=form1 name=form1>
    <div align="center">
    Enter the email message to send:

    <textarea name="txtEmail" cols="50" rows="30"></textarea>

    <input type="submit" name="cmdSubmit" value="Submit">
    </div>
    </form>
    <%
    End If
    %>

    </body>
    </html>

    cosa non và secondo voi????

  5. #5
    carissima, vedi che hai sbagliato di nuovo la sezione in cui postare....


    Cmq ti ho corretto lo stesso tutto il script..

    Nella pagina subscribe.asp e unsubscribe.asp c'era solo errore in sql x questo ti diceva che i campi che hai aggiunto non esistono nel db..

    Invece nel file send.asp c'era lostesso errore sql e visto che usi aruba, ho dovuto modificare l'invio della mail, da CDONTS a CDOSYS perchè aruba non supporta + il vecchio cdonts. :rollo: :rollo:


    Se qualcosa, mi trovi su msn.. Tanti saluti bye...


    PS. Il zip con le mod lo trovi a questo indirizzo:
    http://www.ptokax.com/lavori/ml.zip

  6. #6
    Utente di HTML.it L'avatar di kikysc
    Registrato dal
    Sep 2005
    Messaggi
    93

    Ora si!

    Ti ringrazissimo!!! Ora passo alla fase studio!!! Grazie ancora!

  7. #7
    Utente di HTML.it L'avatar di kikysc
    Registrato dal
    Sep 2005
    Messaggi
    93
    Vorrei aggiungere ancora qualche piccola funzione a questa news letter:
    un contatore esterno per visualizzare il numero delle persone iscritte
    e una conferma di sottoscrizione dell'iscrizione tramite e-mail
    sapreste aiutarmi?
    Grazieeeeeeeeeeeeeeeeeeeee

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.