Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Inviare e-mail

  1. #1

    Inviare e-mail

    Ciao raga, dovrei poter far inviare e-mail da mio sito web a me (salvatore.ciotola@tiscali.it), con questi due file.php. Però quando clicco su invia, mi dice questo errore
    Parse error: syntax error, unexpected '<' in /membri/pianura91/mail.php on line 11

    Cmq questo è il file mail.php
    <?php
    // L’INDIRIZZO DEL DESTINATARIO DELLA MAIL
    $to = "salvatore.ciotola@tiscali.it";

    // IL SOGGETTO DELLA MAIL
    $subject ="www.pianura91.altervista.org";

    // COSTRUZIONE DEL CORPO DEL MESSAGGIO
    $body = "Contenuto del modulo:\n\n";

    $body .= "Dati personali" ;
    "nome: " . trim(stripslashes($_POST["nome"])) . "\n";
    $body .= "cognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
    $body .= "citta: " . trim(stripslashes($_POST["citta"])) . "\n";
    $body .= "Oggetto: " . trim(stripslashes($_POST["oggetto"])) . "\n";
    $body .= "testo: " . trim(stripslashes($_POST["testo"])) . "\n";
    $body .= "mail: " . trim(stripslashes($_POST["mail"])) . "\n";

    // INTESTAZIONI SUPPLEMENTARI
    $headers = "From: Modulo utenti<salvatore.ciotola@tiscali.it>";

    // INVIO DELLA MAIL
    if(mail($to, $subject, $body, $headers)) { // SE L’INOLTRO E’ ANDATO A BUON FINE…

    echo "La mail è stata inoltrata con successo.";

    } else {// ALTRIMENTI…

    echo "Si sono verificati dei problemi nell’invio della mail.";

    }

    ?>




    e questo è il file contatti.php

    <form name="form1" method="post" action="mail.php">
    <table width="95%" align="center" >
    <tr>
    <td colspan="2"><div align="center">MODULO CONTATTI </div></td>
    </tr>
    <tr>
    <td width="16%">Nome</td>
    <td width="84%"><input type="text" name="nome"></td>
    </tr>
    <tr>
    <td>Cognome</td>
    <td><input type="text" name="cognome"></td>
    </tr>
    <tr>
    <td>Citt&agrave; </td>
    <td><input type="text" name="citta"></td>
    </tr>
    <tr>
    <td>Indirizzo E-mail </td>
    <td><input type="text" name="mail"></td>
    </tr>
    <tr>
    <td>Oggetto</td>
    <td><input type="text" name="oggetto"></td>
    </tr>
    <tr>
    <td>Testo</td>
    <td><textarea name="testo" cols="40" rows="10"></textarea></td>
    </tr>
    <tr>
    <td colspan="2"></td>
    </tr>
    <tr>
    <td colspan="2"><div align="center">
    <input type="submit" name="Submit" value="Invia">
    </div></td>
    </tr>
    </table>
    </form>


    Me lo sapreste correggere????

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2008
    Messaggi
    1,317
    $body .= "Dati personali" ;
    "nome: " . trim(stripslashes($_POST["nome"])) . "\n";

    sta riga è sbajata
    ecco na soluzione che potrebbe esse corretta.
    $body .= "Dati personali" . '
    ' . "nome: " . trim(stripslashes($_POST["nome"])) . "\n";

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.