if( isset($_POST['ort']) AND isset($_POST['ort_email']) ) { ...
So kann das Formular zumindest rudimentär identifiziert werden. Dies kann bei mehreren Formularen in der Site wichtig sein.
Der letzte Schritt ist die Filterung des Ortes und Zuweisung zur Variablen "$_POST['ort']" und "$_POST['email']". \\
$value) { // --- location|text*domain:tld
$split =preg_split('/\|/', $value, 2); // Cutting out the location
if (trim($split[0]) == $ort) {
$_POST['ort'] = $ort; // assign the location
// Cutting out and assign the eMail
$_POST['email'] = trim(preg_replace('/(.*)\|(.*)\*(.*):(.*)/is','$2@$3.$4', $value));
break;
};
}
} // ---- END if( $_POST['ort']
?>
An das Formular wird somit der richtige Ort weitergereicht.
\\
==== Backend: ====
{{:deutsch:phpwcms-system:artikel:contentparts:formular:spezielle-anwendungen:php-script-u-funktion:php_script_und_funktion02_be01_de_1.gif|}}
**[Aufklappmenü]** Name: **ortsauswahl**
Bitte wählen-|-
Babaorum
Laudanum
Kleinbonum
Aquarium
\\
**[Versteckt]** Name: **ort_email**
Babaorum|obelix*lokal:arpa#
Laudanum|obelix*lokal:arpa#
Kleinbonum|asterix*lokal:arpa#
Aquarium|idefix*lokal:arpa#
\\
**[Versteckt]** Name: **ort**
nix
\\
**[E-Mail]** Name: **email**
nix
\\
{{:deutsch:phpwcms-system:artikel:contentparts:formular:spezielle-anwendungen:php-script-u-funktion:php_script_und_funktion02_be02_de_1.gif|}}
**Empfängervorlage:**
Hallo {anrede} {name},
E-Mail: {email}
Ort: {ort}
Kommentar:
------------------------------
{kommentar}
------------------------------
Das war alles - Danke.
**Vorlage:**
{ERROR:anrede}[B]{LABEL:anrede}[/B] *[BR]{anrede}[BR][BR]
{ERROR:name}[B]{LABEL:name}[/B] *[BR]{name}[BR][BR]
{ERROR:ortsauswahl}[B]{LABEL:ortsauswahl}[/B] *[BR]{ortsauswahl}[BR][BR]
{ERROR:kommentar}[B]{LABEL:kommentar}[/B][BR]{kommentar}[BR][BR]
{ERROR:nospam}[B]{LABEL:nospam}[/B] *[BR]{nospam}[BR][BR]
{submitIt}