Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem mit Formmailer

Empfohlene Antworten

Veröffentlicht

Hi zusammen!

ich hab da ein schier unlösbares Problem...ein Formmailer der mir die Sonderzeichen verhaut.

Zwei Datein: index.htm mit Formular sowie form.php mit Verarbeitung.

In der HTML wird zunächst das definiert:


<head>

	<title>xxxxxxxxxxx  Kontakt</title>

	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

[...]

[...]

[...]

<form name="kontaktFormular" action="form.php" method="post" accept-charset="iso-8859-1">

[...]

<td><input type="submit" value="Abschicken" class="txtinput"></td>

[...]

In der .php steht folgendes:

<?php


// Allgemeine Einstellungen

$danke_seite  		=	 'thankyou.html';

$pflichtfeld_seite 	= 	 'error.required.html';

$empfaenger  		=	 "meine@mail.de";

$betreff			=	 "Kontaktanfrage";




// Ab hier nichts mehr ändern!

$header 			= 	 'From: '.$_POST['Email_required'].'' . "\r\n" .

   						 'Reply-To: '.$_POST['Email_required'].'' . "\r\n" .

   						 'Content-Transfer-Encoding: 8bit' . "\r\n" .

   						 'X-Mailer: PHP/' . phpversion();		


// Abfrage Pflichtfelder

if ($HTTP_POST_VARS['Vorname_required'] == ''){

	header('Location: '.$pflichtfeld_seite);

	exit;

	}


if ($HTTP_POST_VARS['Name_required'] == ''){

	header('Location: '.$pflichtfeld_seite);

	exit;

	}


if ($HTTP_POST_VARS['Email_required'] == ''){

	header('Location: '.$pflichtfeld_seite);

	exit;

	}



$nachricht = 'Anfrage von: 


Firma: 		'.$_POST['Firma'].'

Vorname: 	'.$_POST['Vorname_required'].'

Nachname: 	'.$_POST['Name_required'].'

Strasse: 	'.$_POST['Strasse'].'

PLZ/Ort: 	'.$_POST['Ort'].'     

E-Mail: 	'.$_POST['Email_required'].'      

Fon: 		'.$_POST['Telefon'].'


Nachricht:

'.$_POST['Nachricht'].'';




    if (@mail($empfaenger, $betreff, $nachricht, $header)){

      	header('Location: '.$danke_seite); 


    } else {

      echo "E-Mail-Verkehr funktioniert zur Zeit nicht<br />";

    }




  function isEmail($email) {

    $nonascii      = "\x80-\xff"; 

    $nqtext        = "[^\\$nonascii\015\012\"]";

    $qchar         = "\\[^$nonascii]";

    $protocol      = "(?:mailto:)";

    $normuser      = "[a-zA-Z0-9][a-zA-Z0-9_.-]*";

    $quotedstring  = "\"(?:$nqtext|$qchar)+\"";

    $user_part     = "(?:$normuser|$quotedstring)";

    $dom_mainpart  = "[a-zA-Z0-9][a-zA-Z0-9._-]*\.";

    $dom_subpart   = "(?:[a-zA-Z0-9][a-zA-Z0-9._-]*\.)*";

    $dom_tldpart   = "[a-zA-Z]{2,5}";

    $domain_part   = "$dom_subpart$dom_mainpart$dom_tldpart";

    $regex         = "$protocol?$user_part\@$domain_part";

    if (preg_match("/^$regex$/",$email)) {

      return true;

    }

    return false;

  }

?>

Die Emails die ankommen werden so dargestellt:

Firma:          tds

Vorname:        gssdfdfg

Nachname:       fgsdf

Strasse:        gdsfgsd ���

PLZ/Ort:        sdfg

E-Mail:         sdfgsdfgs

Fon:            fgsdfg


Nachricht:

d���

(eigentlich sind es kleine schwarze Rauten mit nem "?" drin).

Weiß jemand wo der Hund begraben liegt?

Grüße

Cleriker

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.