Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Form Mail + conferma

  1. #1

    Form Mail + conferma

    Salve, avrei una domandina veloce veloce alla quale non trovo una soluzione ... ho un modulo formmail su server linux di Aruba funzionante, oltre alla pagina di conferma di invio modulo, vorrei aggiungere una conferma, una sorta di ricevuta di ritorno in e-mail a chi usa il form, è una cosa fattibile, se si come ?

    Ah si, la pagina in questione è la seguente CLICCAMI

    grazie 1000 in anticipo

  2. #2
    come non detto ... grazie 1000 lo stesso

  3. #3
    Strano che nessuno sa come aiutarmi

  4. #4
    Codice PHP:
    if(mail(I CAMPI QUA)) {
    mail($chi_invia_dal_form'Conferma email inviata','Email invata correttamente','From: tuamail(a)domain.it');

    Social Network in costruzione.. Misto tra Twitter e Facebook.. Twitbook o facetter?

  5. #5
    Originariamente inviato da 0-c00l
    Codice PHP:
    if(mail(I CAMPI QUA)) {
    mail($chi_invia_dal_form'Conferma email inviata','Email invata correttamente','From: tuamail(a)domain.it');

    Grazie 1000, ma temo non riesco a farlo andare ... il form è in html preso da ARUBA e modificato aggiungendo dei campi

  6. #6
    Forse sono riuscito a trovare qualcosa di interessante, l'invio al mittente funziona, ha anche la sicurezza captcha, ma qualsosa non mi funziona. ho inserito il richiamo delle variabili nei radiobox e checkbox ma e-mail non arriva nulla ... il codice è il seguente:

    <?php
    $your_email ='mail@pippopluto.it';// <<=== update to your email address

    session_start();
    $errors = '';
    $name = '';
    $visitor_email = '';
    $user_message = '';

    if(isset($_POST['submit']))
    {

    $name = $_POST['Cognome'];
    $visitor_email = $_POST['email'];
    $user_message = $_POST['message'];
    ///------------Do Validations-------------
    if(empty($name)||empty($visitor_email))
    {
    $errors .= "\n Nome ed email sono richiesti. ";
    }
    if(IsInjected($visitor_email))
    {
    $errors .= "\n Email non valida!";
    }
    if(empty($_SESSION['6_letters_code'] ) ||
    strcasecmp($_SESSION['6_letters_code'], $_POST['6_letters_code']) != 0)
    {
    //Note: the captcha code is compared case insensitively.
    //if you want case sensitive match, update the check above to
    // strcmp()
    $errors .= "\n The captcha code does not match!";
    }

    if(empty($errors))
    {
    //send the email
    $to = $your_email;
    $subject="Iscrizione GARA";
    $from = $visitor_email;
    $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';

    $body = "$Cognome ti ha mandato iscrizione:\n".
    "Cognome: $Cognome\n".
    "Nome: $Nome\n".
    "Frequenza: $Frequenza\n".
    "Email: $visitor_email \n".
    "Ordine_Transponder: \n".
    "Evento: \n".
    "Message: \n ".
    "$user_message\n".
    "IP: $ip\n";



    $headers = "From: $from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";



    mail($to, $subject, $body,$headers);

    header('Location: grazie.htm');


    //Conferma
    $to = $visitor_email;
    $subject="Conferma Iscrizione";
    $from = $your_email;
    $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';

    $body = "I dati della tua iscrizione sono:\n".
    "Cognome: $Cognome\n".
    "Nome: $Nome\n".
    "Email: $visitor_email \n".
    "Ordine_Transponder: \n".
    "Message: \n ".
    "$user_message\n".
    "IP: $ip\n";



    $headers = "From: $from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";



    mail($to, $subject, $body,$headers);

    header('Location: grazie.htm');

    }

    }

    // Function to validate against any email injection attempts
    function IsInjected($str)
    {
    $injections = array('(\n+)',
    '(\r+)',
    '(\t+)',
    '(%0A+)',
    '(%0D+)',
    '(%08+)',
    '(%09+)'
    );
    $inject = join('|', $injections);
    $inject = "/$inject/i";
    if(preg_match($inject,$str))
    {
    return true;
    }
    else
    {
    return false;
    }
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Contact Us</title>

    <style>
    label,a, body
    {
    font-family : Arial, Helvetica, sans-serif;
    font-size : 12px;
    }
    .err
    {
    font-family : Verdana, Helvetica, sans-serif;
    font-size : 12px;
    color: red;
    }
    </style>

    <script language="JavaScript" src="css/js/gen_validatorv31.js" type="text/javascript"></script>
    </head>

    <body>
    <?php
    if(!empty($errors)){
    echo "<p class='err'>".nl2br($errors)."</p>";
    }
    ?>
    <div id='contact_form_errorloc' class='err'></div>
    <form method="POST" name="contact_form"
    action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">



    <label for='Cognome'>Cognome: </label>


    <input type="text" name="Cognome" value='<?php echo htmlentities($Cognome) ?>'>
    </p>



    <label for='Nome'>Nome: </label>


    <input type="text" name="Nome" value='<?php echo htmlentities($Nome) ?>'>


    </p>



    <label for='Frequenza'>Frequenza: </label>


    <input type="text" name="Frequenza" value='<?php echo htmlentities($Frequenza) ?>'>
    </p>



    <label for='email'>Email: </label>

    <input type="text" name="email" value='<?php echo htmlentities($visitor_email) ?>'>
    </p>



    <input name="Ordine_Transponder" type="checkbox" id="Ordine_Transponder" value="Si">
    <label for="Ordine_Transponder">Ordine Transponder</label>
    </p>



    <label>
    <input type="radio" name="Evento" value="Evento_1" id="Evento_0">
    Evento_1</label>


    <label>
    <input type="radio" name="Evento" value="Evento_2" id="Evento_1">
    Evento_2</label>


    <label>
    <input type="radio" name="Evento" value="Evento_3" id="Evento_2">
    Evento_3</label>


    </p>



    <label for='message'>Message:</label>

    <textarea name="message" rows=8 cols=30><?php echo htmlentities($user_message) ?></textarea>
    </p>



    [img]captcha_code_file.php?rand=<?php echo rand(); ?>[/img]

    <label for='message'>Enter the code above here :</label>

    <input id="6_letters_code" name="6_letters_code" type="text">

    Can't read the image? click here to refresh
    </p>
    <input type="submit" value="Submit" name='submit'>
    </form>
    <script language="JavaScript">
    // Code for validating the form
    // Visit http://www.javascript-coder.com/html...lidation.phtml
    // for details
    var frmvalidator = new Validator("contact_form");
    //remove the following two lines if you like error message box popups
    frmvalidator.EnableOnPageErrorDisplaySingleBox();
    frmvalidator.EnableMsgsTogether();

    frmvalidator.addValidation("name","req","Please provide your name");
    frmvalidator.addValidation("email","req","Please provide your email");
    frmvalidator.addValidation("email","email","Please enter a valid email address");
    </script>
    <script language='JavaScript' type='text/javascript'>
    function refreshCaptcha()
    {
    var img = document.images['captchaimg'];
    img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?ra nd="+Math.random()*1000;
    }
    </script>
    </body>
    </html>

  7. #7
    Ok ... sono riuscito nel mio intento e funziona una meraviglia, ma avrei un'altra cosetta da sistemare nel campo To della mail che arriva, è possibile far vedere un nome ( tipo Pippo Rossi) al posto dell'indirizzo e-mail ?

    Ho provato a inserire il nome manualmente ma arriva con metà nome che avevo impostato e il nome del server ...


    Azzie

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.