Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 19

Discussione: Please Helpmi

  1. #1

    Please Helpmi

    Questo è lo script:
    <%

    dim user

    dim pwd

    user=replace(request.form("form_user"),"'","''")

    pwd=replace(request.form("form_pwd"),"'","''")

    if user <>"LEO" then

    response.redirect("accesso negato.htm")

    end if

    if pwd <> "LEO" then

    response.redirect("accesso negato.htm")

    end if

    session("verificato") = "si"

    response.redirect "gestmail.asp"

    %>

    Questa è una modifica che ho provato ad apportare:



    <%

    dim user

    dim pwd

    user=replace(request.form("form_user"),"'","''")

    pwd=replace(request.form("form_pwd"),"'","''")

    if user <>"LEO" then

    response.redirect("accesso negato.htm")

    end if

    if pwd <> "LEO" then

    response.redirect("accesso negato.htm")

    end if

    session("verificato") = "si"

    response.redirect "gestmail.asp"

    %>

    Questo è l'errore costante alle due ipotesi:
    Active Server Pages error 'ASP 0131'

    Disallowed Parent Path

    /newsletter/admin/gestmail.asp, line 15

    The Include file '../adovbs.inc' cannot contain '..' to indicate the parent directory.

    Gentilmente qualcuno mi può dire cosa correggere, forse sbaglio a pubblicarlo, non lo so.
    Grazie.

  2. #2
    Utente di HTML.it L'avatar di Lak3d
    Registrato dal
    Aug 2006
    Messaggi
    1,031
    The Include file '../adovbs.inc' cannot contain '..' to indicate the parent directory.

  3. #3
    devi usare include virtual
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  4. #4

    Non mi è chiaro....

    Scusate le mie mancanze conoscitive, comunque io provato ad inserire include virtual (come nel secondo esempio di script), ma non sono riuscito a risolvere il problema, se qualcuno fosse così gentile da spiegarmi materialmente come modificarlo gliene sarei grato.
    Ciao.

  5. #5
    Devi modificare l'inclusione del file adovbs.inc che si trova alla riga 15 del file gestmail.asp.
    Ci sono i ".." che non ci devono essere.

  6. #6

    ADESSO ho un altro errore

    Grazie ho corretto l'errore precedente, ma adesso mi spunta un altro errore

    Microsoft VBScript compilation error '800a03f6'

    Expected 'End'

    /newsletter/admin/gestmail.asp, line 135

    Ma alla linea 135 l'End c'è.............. l'ho inserito e se provo a cancellare lo script finale a cui si riferisce mi da un altro errore su un'altra parte dello script dove anche lì c'è l'End, ma non lo rileva.

    <%
    ' CONTROLLA SE SI E' IDENTIFICATI
    IF session("amministratore")<>true then
    Response.Redirect "index.asp"
    End IF
    %>
    <html>

    <head>
    <title>GESTIONE NEWSLETTER</title>
    </head>

    <body background="../../sfondo3.JPG">

    <font size="4" face="Verdana">&gt; Invia newsletter!</font></p>


    <%
    ' LEGGE QUELLO CHE DEVE FARE
    operazione = Request.QueryString("tipo")

    ' PERCORSO DEL DATABASE
    url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/database.mdb")

    Set Conn = Server.CreateObject("ADODB.Connection")
    conn.Open url_DB

    ' OPERAZIONE = INVIA IL MESSAGGIO DI NEWSLETTER
    IF operazione = "invia" then

    ' VERIFICA CHE I CAMPI SIANO STATI COMPILATI
    IF Request("oggetto") <> "" and Request("testo") <> "" then

    ' APRE LA CONNESSIONE AL DATABASE E PRELEVA LE EMAIL DELLA NEWSLETTER

    Set RecSet = Server.CreateObject("ADODB.Recordset")
    SQL = "SELECT * FROM Email_Newsletter"
    RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic

    IF not RecSet.Eof then

    ' INDIRIZZO EMAIL NOSTRO
    mittente = "webmaster@leocapodorlando.eu"

    Do until Recset.eof

    ' PRELEVA L'EMAIL DELL'UTENTE DAL NOSTRO DATABASE
    destinatario = RecSet("email")

    ' PRELEVA IL TESTO DEL MESSAGGIO DA INVIARE
    testo = Request.Form("testo")

    ' PRELEVA L'OGGETTO DEL MESSAGGIO DA INVIARE
    oggetto = Request.Form("oggetto")

    ' INVIA IL MESSAGGIO
    Set email = CreateObject("CDONTS.NewMail")
    email.From = mittente
    email.To = destinatario
    email.Subject = oggetto

    ' FORMATO EMAIL
    email.BodyFormat = Request.Form("formato")
    email.MailFormat = Request.Form("formato")


    email.Body = testo

    ' INVIA L'EMAIL E..
    email.Send

    Set email = nothing

    ' PASSA AVANTI...
    RecSet.Movenext
    loop

    End If

    RecSet.Close
    Conn.close
    Set RecSet = Nothing
    Set Conn = Nothing

    ' VISUALIZZA UN MESSAGGIO DI CONFERMA:
    %>
    <hr>
    <p align="center"><font face="Verdana" size="4">Messaggio inviato
    correttamente!
    </font></p>
    <p align="center">
    [img]../../logoleo2.gif[/img]</p>
    <hr>
    <%
    Else
    %>
    <hr>
    <p align="center"><font face="Verdana" size="4">Compila tutti i campi!</font></p>
    <p align="center">
    [img]../../logoleo2.gif[/img]</p>
    <hr>
    <font face=Verdana" color=#0000FF size=5>
    <p align="center">Creazione E-mail

    [img]../../logoleo2.gif[/img]</font></p>
    <form method="POST" action="Gestione_Newsletter.asp?tipo=invia">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Oggetto messaggio:</font></td>
    <td width="74%"><font face="Verdana" size="2">
    <input type="text" name="oggetto" size="34"></font></td>
    </tr>
    <tr>
    <td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Testo messaggio:</font></td>
    <td width="74%"><font face="Verdana" size="2"><textarea rows="6" name="testo" cols="67"></textarea></font></td>
    </tr>
    <tr>
    <td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Formato e-mail:</font></td>
    <td width="74%"><select size="1" name="formato">
    <option selected value="1">Testo</option>
    <option value="0">HTML</option>
    </select></td>
    </tr>

    <tr>
    <td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Numero iscritti:</font></td>
    <%
    ' CONTA GLI ISCRITTI ALLA NEWSLETTER
    Set RecSet = Server.CreateObject("ADODB.Recordset")
    SQL = "SELECT Count(*) FROM Email_Newsletter"
    RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic

    ' CONTA GLI ISCRITTI

    IF not RecSet.Eof then
    Iscritti = RecSet(0)
    Else
    Iscritti = 0
    End if
    %>
    <td width="74%"><font face="Verdana" size="2"><%=Iscritti%></font></td>
    <%
    IF RecSet.Close then
    End if
    %>
    </tr>
    <tr>
    <td width="100%" colspan="2"><input type="submit" value="Invia Newsletter!" name="B1"><input type="reset" value="Reimposta" name="B2"></td>
    </tr>
    </table>
    </form>


    </p>
    <%
    IF Conn.Close then
    Set Conn = Nothing
    Set RecSet = Nothing
    End IF
    %>
    </body>

    </html>

  7. #7
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Prima di chiedere aiuto leggi il regolamento.

    Roby

  8. #8

    Scusate se ho infranto qualche regola, ma non capisco quale?

    Sicuramente è chiaro che sono nuovo al mondo Asp, per questo ho fatto delle domande che sicuramente per Voi sono scontate nelle risposte, ma vi assicuro che ho cercato di fare tutti i tentativi possibili per risolvere i precedenti problemi, magari non nell'ultimo caso, questo è vero, ma generalmente se non sono davvero stanco di provare a vuoto non scomodo gli altri; dunque, nell'invitarmi a guardare il regolamento su cosa vuoi spingermi a riflettere???? L'ho letto ma non credo che le mie domande contenessero questioni non attinenti o equivoche. Comunque se non ritieni che siano domande da porsi, accolgo l'invito e mi astengo dal farlo, pensavo di trovare un aiuto per un principiante come me in gente esperta come Voi. Se ho frainteso ti chiedo la cortesia di delucidarmi sul riferimento al regolamento. Grazie.

  9. #9
    Utente di HTML.it L'avatar di Lak3d
    Registrato dal
    Aug 2006
    Messaggi
    1,031
    codice:
    <%
    IF session("amministratore")<>true then
       Response.Redirect "index.asp"
    End IF
    %>
    <html>
    <head>
    <title>GESTIONE NEWSLETTER</title>
    </head>
    
    <body background="../../sfondo3.JPG">
    
    <font size="4" face="Verdana">&gt; Invia newsletter!</font></p>
    
    
    <%
    operazione = Request.QueryString("tipo")
    url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/database.mdb")
    
    Set Conn = Server.CreateObject("ADODB.Connection")
    conn.Open url_DB
    
    If operazione = "invia" then
       If Request("oggetto") <> "" and Request("testo") <> "" then
          Set RecSet = Server.CreateObject("ADODB.Recordset")
          SQL = "SELECT * FROM Email_Newsletter"
          RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
          If not RecSet.Eof then
             mittente = "webmaster@leocapodorlando.eu"
             Do until Recset.eof
                destinatario = RecSet("email")
                testo = Request.Form("testo")
                oggetto = Request.Form("oggetto")
                Set email = CreateObject("CDONTS.NewMail")
                email.From = mittente 
                email.To = destinatario
                email.Subject = oggetto
                email.BodyFormat = Request.Form("formato")
                email.MailFormat = Request.Form("formato")
                email.Body = testo
                email.Send
                Set email = nothing
                RecSet.Movenext
             Loop
          End If
          RecSet.Close
          Conn.close
          Set RecSet = Nothing
          Set Conn = Nothing
          %>
         <hr>
    <p align="center"><font face="Verdana" size="4">Messaggio inviato correttamente!</font></p>
    <p align="center">
    [img]../../logoleo2.gif[/img]</p>
    <hr>
    <%
       Else
    %>
    <hr>
    <p align="center"><font face="Verdana" size="4">Compila tutti i campi!</font></p>
    <p align="center">
    [img]../../logoleo2.gif[/img]</p>
    <hr>
    <font face=Verdana" color=#0000FF size=5>
    <p align="center">Creazione E-mail
    
    [img]../../logoleo2.gif[/img]</font></p>
    <form method="POST" action="Gestione_Newsletter.asp?tipo=invia">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Oggetto messaggio:</font></td>
    <td width="74%"><font face="Verdana" size="2">
    <input type="text" name="oggetto" size="34"></font></td>
    </tr>
    <tr>
    <td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Testo messaggio:</font></td>
    <td width="74%"><font face="Verdana" size="2"><textarea rows="6" name="testo" cols="67"></textarea></font></td>
    </tr>
    <tr>
    <td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Formato e-mail:</font></td>
    <td width="74%"><select size="1" name="formato">
    <option selected value="1">Testo</option>
    <option value="0">HTML</option>
    </select></td>
    </tr>
    
    <tr>
    <td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Numero iscritti:</font></td>
    <%
    Set RecSet = Server.CreateObject("ADODB.Recordset")
    SQL = "SELECT Count(*) FROM Email_Newsletter"
    RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
    IF not RecSet.Eof then
       Iscritti = RecSet(0)
    Else
       Iscritti = 0
    End if
    %>
    <td width="74%"><font face="Verdana" size="2"><%=Iscritti%></font></td>
    <%
    IF RecSet.Close then
    End if
    %>
    </tr>
    <tr>
    <td width="100%" colspan="2"><input type="submit" value="Invia Newsletter!" name="B1"><input type="reset" value="Reimposta" name="B2"></td>
    </tr>
    </table>
    </form>
    
    
     </p>
    <%
    IF Conn.Close then
       Set Conn = Nothing
       Set RecSet = Nothing
    End IF
    
    %>
    Gli if grassettati non hanno end if, come del resto ti indicava il debugger. Sta a te metterli dove vuoi in base a quello che devi fare...

  10. #10

    Grazie lo stesso.

    Grazie tante per l'aiuto anche se non ho risolto il problema. Spero di riuscirci in seguito.
    Buona serata.

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.