Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Variabile Referer

  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    101

    Variabile Referer

    Sto creando un semplice form mail che sia in grado di dirmi da quale pagina del mio sito il visitatori ha mandato la segnalazione.
    La pagina php dedicata all'invio dell'email è questa:

    Codice PHP:
    <?php
    $goto_after_mail 
    "thanks.htm"// this is the page which is shown after the mail is submitted
    $from_mail $_REQUEST['from_email'];
    $from_name $_REQUEST['from_name']; // use both value's from your form
    $header "From: \"$from_name\" <$from_mail>\r\n";
    $header .= "MIME-Version: 1.0\r\n";
    $header .= "Content-Type: text/plain; charset=\"utf-8\"\r\n";
    $header .= "Content-Transfer-Encoding: 7bit\r\n";
    $subject "Your webform posted at ".date("d-m-Y"); //your mailsubject incl. current date
    $page $_SERVER['HTTP_REFERER']; 
    foreach (
    $_REQUEST as $key => $val) {
        if (
    $key != "from_email" && $key != "from_name") { //skip, this values are already in the header
            
    $body .= $key " : " $val "\r\n";
        }
    }
    if (
    mail("info@dominio.it"$subject$body$page$header)) {
        
    header("Location: ".$goto_after_mail);
    }
    ?>
    Il problema è che la pagina di provenienza non mi viene scritta nel corpo dell'e-mail ma nell'intestazione del messaggio.
    Dove ho sbagliato?
    Grazie mille!
    Mr Blade
    ----------
    The Art Of Sailing

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    101
    Problema RISOLTO:

    Ho messo la variabile $page prima di $body

    Codice PHP:
    (mail("info@dominio.it"$subject$page$body$header)) 
    Mr Blade
    ----------
    The Art Of Sailing

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.