TomCZ20: Post Variable in PHP Mail einbinden

Servus!

Ich habe die Datei 1.php. Diese beinhaltet ein Formular welches per POST daten an 2.php übergibt.

2.php macht folgendes:
$test = $_POST["testvariable"];
echo $test; gibt den Inhalt auch einwandfrei aus.

Nun versende ich eine eMail:
Der eMailText lautet:

$emailtext = 'blah blah <?php echo $test; ?>';

Die eMail kommt an, Die variable kommt aber nicht mit an, der Platz bleibt leer.

was mache ich da falsch?

Grüße, Thomas

  1. $emailtext = 'blah blah <?php echo $test; ?>';

    Die eMail kommt an, Die variable kommt aber nicht mit an, der Platz bleibt leer.

    was mache ich da falsch?

    $emailtext = 'blah blah '.$test;

    Gruß, Samoht

    --
    fl:| br:> va:) ls:< n4:( ss:) de:] js:| mo:}
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."
    (Kristian Wilson, Nintendo, 1989)
  2. Hi Thomas,

    $emailtext = 'blah blah <?php echo $test; ?>';

    Da würde ich gerne mal den gesamten Quellcode sehen.

    Da du $emailtext ja auch schon in PHP schreibst, brauchst du eigentlich nur:

    $emailtext = 'blah blah '.$test;

    machen. Wenn $test deine $_POST Variable enthält.