Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it L'avatar di Emos
    Registrato dal
    Feb 2002
    Messaggi
    81

    non riesco a fare un form in php

    Ciao a tutti,
    ho provato a inserire vari form in php sul mio sito hostato su aruba (form action="send.php" method="post") ma quando li testo mi dice sempre:
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, postmaster@commemorazione.it and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
    E dal log di aruba si legge:
    [Sun Nov 11 03:01:48 2007] [error] [client 82.58.111.67] Premature end of script headers: send.php, referer: http://www.***.it/commemorazione/Sito/preventivo.html
    Che devo fare?
    HELP!
    Grazie
    Emanuele
    _^--^_
    Emanuele ;-()

  2. #2
    Utente di HTML.it L'avatar di Emos
    Registrato dal
    Feb 2002
    Messaggi
    81
    Per favore, so che è una domanda banale, ma non so più che fare!
    HELP!
    Grazie
    _^--^_
    Emanuele ;-()

  3. #3
    Avremmo bisogno del codice PHP contenuto in form/send.php per poter dare un giudizio.

  4. #4
    Utente di HTML.it L'avatar di Emos
    Registrato dal
    Feb 2002
    Messaggi
    81
    Codice PHP:
    <?php



    /***  Settaggio variabili globali PHP/4.1.2  ***/

    if (!isset($_SERVER)) {$_SERVER $HTTP_SERVER_VARS;}

    if (!isset(
    $_GET)) {$_GET $HTTP_GET_VARS;}

    if (!isset(
    $_POST)) {$_POST $HTTP_POST_VARS;}

    if (!isset(
    $_COOKIE)) {$_COOKIE $HTTP_COOKIE_VARS;}

    if (!isset(
    $_FILES)) {$_FILES $HTTP_POST_FILES;}

    if (!isset(
    $_ENV)) {$_ENV $HTTP_ENV_VARS;}

    if (!isset(
    $_SESSION)) {$_SESSION $HTTP_SERVER_VARS;}



    /***  Impostazione dei messaggi di errore (solo per testing)  ***/

    error_reporting(1);



    /***  Lettura del template  ***/

    $template_code implode("",file($_POST['template_file']));



    /***  Sostituzione dei valori  ***/

    $parsed preg_replace('/()/e''$_POST[\'$2\']'$template_code);



    /***  Lettura dei valori  ***/

    $splitted explode("#-#-#-#",$parsed);

    $vars = array(

    "from_name" => trim($splitted[0]),

    "from_mail" => trim($splitted[1]),

    "to_name" => trim($splitted[2]),

    "to_mail" => trim($splitted[3]),

    "reply_name" => trim($splitted[4]),

    "reply_mail" => trim($splitted[5]),

    "subject" => trim($splitted[6]),

    "body" => $splitted[7],

    "sent" => $splitted[8]

    );



    /***  Controllo dei campi  ***/

    if (($vars['from_name'] == "") || ($vars['from_mail'] == "") || ($vars['to_name'] == "") || ($vars['to_mail'] == "") || ($vars['reply_name'] == "") || ($vars['reply_mail'] == "") || ($vars['subject'] == "") || ($vars['body'] == "")) {exit();}



    /***  Scrittura degli headers SMTP  ***/

    $headers "MIME-Version: 1.0\r\n";

    $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";

    $headers .= "Content-Transfer-Encoding: 8bit\r\n";

    $headers .= "From: \"".$vars['from_name']."\" <".$vars['from_mail'].">\r\n";

    $headers .= "To: \"".$vars['to_name']."\" <".$vars['to_mail'].">\r\n";

    $headers .= "Reply-To: \"".$vars['reply_name']."\" <".$vars['reply_mail'].">\r\n";

    $headers .= "X-Mailer: Scitrek PHP Mailer";



    /***  Invio della mail e operazioni successive  ***/

    if (mail($vars['to_mail'],$vars['subject'],$vars['body'],$headers)) {

        if (
    stristr($vars['sent'],"goto=")) {

            
    $goto str_replace("goto=","",trim($vars['sent']));

            
    header("Location: ".$goto);

        }

        else {echo 
    $vars['sent'];}

    }



    ?>
    grazie
    _^--^_
    Emanuele ;-()

  5. #5
    Leggi bene questa riga del codice
    Codice PHP:
    if (($vars['from_name'] == "") || ($vars['from_mail'] == "") || ($vars['to_name'] == "") || ($vars['to_mail'] == "") || ($vars['reply_name'] == "") || ($vars['reply_mail'] == "") || ($vars['subject'] == "") || ($vars['body'] == "")) {exit();} 
    Questa va a cercare i valori inseriti negli elementi "input" con name o id dai valori from_mail, to_name, to_mail etc e controlla che non siano vuoti.
    Ma tu hai cambiato tutti gli attributi name del form, come pretendi possa funzionare?
    O cambi il nome nello script o nel modulo.

  6. #6
    Utente di HTML.it L'avatar di Emos
    Registrato dal
    Feb 2002
    Messaggi
    81
    ciao,
    ho cambiato tutti i dati qui:
    Codice PHP:
    /***  Controllo dei campi  ***/

    if (($vars['commemorazione_di'] == "") || ($vars['formatoda_testo'] == "") || ($vars['formatoda_immagini'] == "") || ($vars['formatoda_filmati'] == "") || ($vars['formatoda_musica'] == "") || ($vars['entro_il'] == "") || ($vars['nomecognome'] == "") || ($vars['email'] == "") || ($vars['citta'] == "") || ($vars['altri_Recapiti'] == "") || ($vars['commenti'] == "")) {exit();} 

    Ma mi dà lo stesso identico errore!
    :rollo:
    Mi sento stupido...
    _^--^_
    Emanuele ;-()

  7. #7
    Non solo in quella riga...
    Come puoi vedere i nomi sono ripetuti svariate volte nello script.

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.