Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Problemi con form mail

  1. #1

    Problemi con form mail

    Non mi funziona questo form mail (che ho scaricato da questo sito)

    Codice nella pagina:

    codice:
    <form method="post" action="send.php">
    <p align="center"></p>
    <p align="center"><font size="2" face="Verdana">Nome </font>
    <font face="Verdana"><input name="name" type="text" size="30" maxlength="40" /></font><font face="Verdana" size="2">
    
    
    E-mail </font><font face="Verdana"><input name="email" type="text" size="30" maxlength="40" /></font><font size="2" face="Verdana">
    
    
    Oggetto</font><font face="Verdana"><font size="2"> </font><input name="subject" type="text" size="30" maxlength="40" /></font>
    
    <textarea name="msg" cols="50" rows="6"></textarea>
    
    
    <font face="Verdana">
    <input type="reset" value="Cancella" /></font><input type="submit" value="Invia" /></p>
    <p align="center"></p>
    </form>
    Codice send.php

    codice:
    <?php
    $receiverMail	= "info@vestirsibene.com";
    
    $name		= ltrim(rtrim(strip_tags(stripslashes($_POST['name']))));
    $email		= ltrim(rtrim(strip_tags(stripslashes($_POST['email']))));
    $subject	= ltrim(rtrim(strip_tags(stripslashes($_POST['subject']))));
    $msg		= ltrim(rtrim(strip_tags($_POST['msg'])));
    
    $ip		= getenv("REMOTE_ADDR");
    $msgformat	= "From: $name ($ip)\nEmail: $email\n\n$msg";
    
    
    if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
    	echo "<h3>L'email non è stata inviata</h3>
    
    Bisogna compilare tutti i moduli</p>";
    }
    elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
    	echo "<h3>L'email non è stata inviata</h3>
    
    L'indirizzo email non esiste</p>";
    }
    else {
    	mail($receiverMail, $subject, $msgformat, "From: $name <$email>");
    	echo "<h3>L'email è stata inviata correttamente</h3>
    
    Riceverai una risposta il prima possibile</p>"; }
    ?>

  2. #2
    ma perchè nessuno capisce che dicendo "non funziona" non si da nessun aiuto per una soluzione?

    cosa fa esattamente?

    metti nella prima riga un bel error_reporting(E_ALL) (vedere mia pillola in merito) peressere sicuri che siano visualizzati tutti gli errori

  3. #3
    Scrivo il form e viene visualizzato una pagina con il seguente errore:

    The page cannot be displayed
    The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
    --------------------------------------------------------------------------------

    Please try the following:

    Contact the Web site administrator if you believe that this request should be allowed.
    Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
    HTTP Error 405 - The HTTP verb used to access this page is not allowed.
    Internet Information Services (IIS)

    --------------------------------------------------------------------------------

    Technical Information (for support personnel)

    Go to Microsoft Product Support Services and perform a title search for the words HTTP and 405.
    Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Setting Application Mappings, Securing Your Site with Web Site Permissions, and About Custom Error Messages.

  4. #4
    sembrerebbe che iis non riconosca il metodo post

  5. #5
    Scusa la mia ignoranza... Quindi cosa dovrei fare? Non sono molto pratico...

  6. #6
    non lo so.. non sembra esserci un errore nel codice.. quanto piuttosto iis ad essere svalvolato

    hai provato su un altro webserver? se stai lavorando in locale ti consiglio apache... se è il server remoto ed è l'unico di cui disponi. prova in locale o su un account gratuito temporaneo... e in caso altrove funzioni fai presente la cosa al tuo hoster


  7. #7
    Grazie ora va finalmente...
    Un'altra domanda... Come posso fare a far vedere la pagina send.php tramite pop-up o qualcosa di simile?

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.