Visualizzazione dei risultati da 1 a 8 su 8

Discussione: errore form mail

  1. #1

    errore form mail

    Ho provato la form mail e nonostante tutti i campi siano stati compilati mi restituisce "Tutti i ....". Il codice della pagina html o meglio php e' correto.
    Questo e' il codice php a cui il form restituisce i dati:

    <?php
    $mail = "fumatodimaria@katamail.com";
    $subject = "Comunicazione dal sito web";
    if (isset($_POST['nome']) AND isset($_POST['cognome']) AND isset($_POST['email']) AND isset($_POST['messaggio'])){
    mail($mail, $subject, "From: {$_POST['nome']} -- {$_POST['cognome']} -- {$_POST['email']} -- MESSAGGIO: {$_POST['messaggio']}");
    $msg = "Il tuo messaggio è stato inviato, grazie.";
    } else {
    $msg = "Tutti i campi devono essere compilati. ";
    }
    ?>


    <?php echo $msg; ?></p>


    Grazie

  2. #2
    Utente di HTML.it L'avatar di Avalox
    Registrato dal
    Nov 2003
    Messaggi
    302
    prova a postare anche il form e magari prova a farti stampare a video cosa contiene $_POST aggiungendo queste righe all'inizio del tuo script php:

    codice:
    echo "<pre>";
    print_r($_POST);
    echo "</pre>";
    Fammi sapere

  3. #3
    codice html...lo so sono tabelle! :
    <form method="post" action="../_private/mailto.php">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
    <tr>
    <td align="left" valign="middle" height="100%" width="100%">
    <font face="arial narrow, sans-serif">Nome</font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    <td align="left" colspan="2">
    <input type="text" size="22" name="nome" maxlength="30">
    </td>
    <td height="51"></td>
    </tr>
    <tr>
    <td align="left">
    <table cellpadding="0" cellspacing="0" width="94" height="32">
    <tr>
    <td width="15">
    [img]../images/MsSpacer.gif[/img]</td>
    <td height="32" width="79">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
    <tr>
    <td align="left" valign="middle" height="100%" width="100%">
    <font face="arial narrow, sans-serif">Cognome</font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    <td colspan="2">
    <input type="text" size="22" name="cognome" maxlength="30"></td>
    <td valign="top" align="center" style="text-align: justify; padding-left: 90px; padding-top: 50px; padding-right: 0px; color : #000000; font-family : arial narrow, sans-serif
    ; font-size : 10pt;" rowspan="3"><font face="Arial Narrow"><font size="3">Contact</font>: info@avd.it
    </font>
    </td>
    <td height="33"></td>
    </tr>
    <tr>
    <td align="left">
    <table cellpadding="0" cellspacing="0" width="94" height="32">
    <tr>
    <td width="15">
    [img]../images/MsSpacer.gif[/img]</td>
    <td height="32" width="79">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
    <tr>
    <td align="left" valign="middle" height="100%" width="100%">
    <font face="arial narrow, sans-serif
    ">E-mail</font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    <td colspan="2">
    <input type="text" size="22" name="email" maxlength="30"></td>
    <td height="33"></td>
    </tr>
    <tr>
    <td align="left" valign="top">
    <table cellpadding="0" cellspacing="0" width="94" height="163">
    <tr>
    <td width="15">
    [img]../images/MsSpacer.gif[/img]</td>
    <td height="163" width="79">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
    <tr>
    <td align="left" valign="middle" height="100%" width="100%">
    <font face="arial narrow, sans-serif">Testo</font></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    <td colspan="2"><textarea rows="7" cols="21" name="messaggio"></textarea></td>
    <td height="163"></td>
    </tr>
    <tr>
    <td align="center" valign="top" colspan="2">
    <input type="submit" value="Invia"></td>
    <td align="center" valign="top">
    <input type="reset" value="Reset"></td></form>

  4. #4

  5. #5
    Utente di HTML.it L'avatar di Avalox
    Registrato dal
    Nov 2003
    Messaggi
    302
    Originariamente inviato da Avalox
    ...prova a farti stampare a video cosa contiene $_POST aggiungendo queste righe all'inizio del tuo script php:

    codice:
    echo "<pre>";
    print_r($_POST);
    echo "</pre>";
    Fammi sapere
    Scusa se mi ripeto...ma questo è fondamentale per vedere cosa viene passato alla tua applicazione...

  6. #6
    ho provato cosi':

    <?php
    echo "<pre>";
    print_r($_POST);
    echo "</pre>";
    $mail = "fumatodimaria@katamail.com";
    $subject = "Comunicazione dal sito web";
    if (isset($_POST['nome']) AND isset($_POST['cognome']) AND isset($_POST['email']) AND isset($_POST['messaggio'])){
    mail($mail, $subject, "From: {$_POST['nome']} -- {$_POST['cognome']} -- {$_POST['email']} -- MESSAGGIO: {$_POST['messaggio']}");
    $msg = "Il tuo messaggio è stato inviato, grazie.";
    } else {
    $msg = "Tutti i campi devono essere compilati. ";
    }
    ?>


    <?php echo $msg; ?></p>


    ma nn mi restituisce niente.
    Grazie ciao

  7. #7

  8. #8
    Qualcuno mi può aiutare? Alcune persone a cui ho posto il problema mi hanno detto che da loro, in locale sembra funzionare. Può anche essere che il sito ha un "redirect"? grazie

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.