Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente bannato
    Registrato dal
    Nov 2003
    Messaggi
    218

    Aggiungere Msg Di Errore In Un Form Mail

    CIAO A TUTTI...
    ALLORA IO HO UN FORM MAIL SUL SITO...MA VORREI INSERIRE L'OPZIONE CHE SE RISULTA ESSERE VUOTO UN CAMPO O L'E-MAIL è SBAGLIATA IL MSG NON VIENE INVIATO...CON UN AVVISO "INDIRIZZO NON VALIDO" PER ESEMPIO...

    QST è LO SCRIP FLASH(AZIONE)

    rec = "rombetto@hotmail.com";
    serv = "php";
    var fields_descriptions = Array("", Array("t1", "your_name", "Nome & Cognome:"), Array("t2", "your_email", "Indirizzo E-mail:"), Array("t3", "telephone", "Telefono:"), Array("t4", "message", "Il vostro messaggio:"));
    function reset_txt(name, name2, value) {
    path = eval(_target);
    path[name2] = value;
    this[name].onSetFocus = function() {
    path = eval(_target);
    if (path[name2] == value) {
    path[name2] = "";
    }
    };
    this[name].onKillFocus = function() {
    path = eval(_target);
    if (path[name2] == "") {
    path[name2] = value;
    }
    };
    }
    for (i=1; i<=fields_descriptions.length; i++) {
    reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]);
    }



    POI CI SONO UN FILE PHP E UNO ASP

    QUESTO è ASP
    <%
    for i=1 to 7
    message=Request("message")
    next
    message=message + Request("message")
    smtpServer = "smtp.aruba.it"
    smtpPort = 25


    name = Request("Your_Name:")
    Set myMail = CreateObject("CDO.Message")
    myMail.Subject = "from " & name
    myMail.From = Request("Your_Email:")
    myMail.To = Request("recipient")
    myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body>
    " & message & "</body></html>"
    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = smtpPort
    myMail.Configuration.Fields.Update
    myMail.Send

    %>


    QUESTO è PHP
    <?
    Error_Reporting(E_ALL & ~E_NOTICE);

    while ($request = current($_REQUEST)) {
    if (key($_REQUEST)!='recipient') {
    $pre_array=split ("&777&", $request);
    $post_vars[key($_REQUEST)][0]=$pre_array[0];
    $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
    }



    reset($post_vars);
    $subject="From ".$post_vars['your_name'][0] ;
    $headers= "From: ".$post_vars['your_email'][0] ."\n";
    $headers.='Content-type: text/html; charset=iso-8859-1';
    $message='';
    while ($mess = current($post_vars)) {
    if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {

    $message.="".$mess[1]."".$mess[0]."
    ";
    }
    next($post_vars);
    }

    mail($_REQUEST['recipient'], $subject, "
    <html>
    <head>
    <title>Contact letter</title>
    </head>
    <body>


    ".$message."
    </body>
    </html>" , $headers);
    echo ("Il vostro messaggio è stato inviato con successo!");



    GRAZIE..CIAO

  2. #2
    Utente bannato
    Registrato dal
    Nov 2003
    Messaggi
    218

    Re: Aggiungere Msg Di Errore In Un Form Mail

    Originariamente inviato da rombetto
    CIAO A TUTTI...
    ALLORA IO HO UN FORM MAIL SUL SITO...MA VORREI INSERIRE L'OPZIONE CHE SE RISULTA ESSERE VUOTO UN CAMPO O L'E-MAIL è SBAGLIATA IL MSG NON VIENE INVIATO...CON UN AVVISO "INDIRIZZO NON VALIDO" PER ESEMPIO...

    QST è LO SCRIP FLASH(AZIONE)

    rec = "rombetto@hotmail.com";
    serv = "php";
    var fields_descriptions = Array("", Array("t1", "your_name", "Nome & Cognome:"), Array("t2", "your_email", "Indirizzo E-mail:"), Array("t3", "telephone", "Telefono:"), Array("t4", "message", "Il vostro messaggio:"));
    function reset_txt(name, name2, value) {
    path = eval(_target);
    path[name2] = value;
    this[name].onSetFocus = function() {
    path = eval(_target);
    if (path[name2] == value) {
    path[name2] = "";
    }
    };
    this[name].onKillFocus = function() {
    path = eval(_target);
    if (path[name2] == "") {
    path[name2] = value;
    }
    };
    }
    for (i=1; i<=fields_descriptions.length; i++) {
    reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]);
    }



    POI CI SONO UN FILE PHP E UNO ASP

    QUESTO è ASP
    <%
    for i=1 to 7
    message=Request("message")
    next
    message=message + Request("message")
    smtpServer = "smtp.aruba.it"
    smtpPort = 25


    name = Request("Your_Name:")
    Set myMail = CreateObject("CDO.Message")
    myMail.Subject = "from " & name
    myMail.From = Request("Your_Email:")
    myMail.To = Request("recipient")
    myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body>
    " & message & "</body></html>"
    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
    myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = smtpPort
    myMail.Configuration.Fields.Update
    myMail.Send

    %>


    QUESTO è PHP
    <?
    Error_Reporting(E_ALL & ~E_NOTICE);

    while ($request = current($_REQUEST)) {
    if (key($_REQUEST)!='recipient') {
    $pre_array=split ("&777&", $request);
    $post_vars[key($_REQUEST)][0]=$pre_array[0];
    $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
    }



    reset($post_vars);
    $subject="From ".$post_vars['your_name'][0] ;
    $headers= "From: ".$post_vars['your_email'][0] ."\n";
    $headers.='Content-type: text/html; charset=iso-8859-1';
    $message='';
    while ($mess = current($post_vars)) {
    if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {

    $message.="".$mess[1]."".$mess[0]."
    ";
    }
    next($post_vars);
    }

    mail($_REQUEST['recipient'], $subject, "
    <html>
    <head>
    <title>Contact letter</title>
    </head>
    <body>


    ".$message."
    </body>
    </html>" , $headers);
    echo ("Il vostro messaggio è stato inviato con successo!");



    GRAZIE..CIAO

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.