NAVIGATION
This shows you the differences between two versions of the page.
|
english:phpwcms-system:article:contentparts:form:special-applications:php-script-and-function:field-transfer-v2 [2010/07/18 09:48] Knut Heermann (flip-flop) |
english:phpwcms-system:article:contentparts:form:special-applications:php-script-and-function:field-transfer-v2 [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ====== Field transfer V2 ====== | ====== Field transfer V2 ====== | ||
| - | On the basis a local selection a certain email address is to be selected and handed over. Version 02. | + | Based on a local selection a certain email address is selected and passed over. Version 02. |
| Advantages over V1: \\ | Advantages over V1: \\ | ||
| - | The correct case of an error in the select menu "Ortsauswahl" is taken off. Even with a second error input, the focus remains in the drop down box on the previous selection. \\ | + | * The complete case of an error in the select menu "Ortsauswahl" will be covered. Even if a second incorrect input is following a first one, the focus will remain in the drop down box previously selected. \\ |
| - | The e-mail addresses are included in encoded form to give SPAM robots no selection possibility. | + | * The e-mail addresses are included in encoded form to give SPAM robots no selection possibility. |
| + | <note> | ||
| + | Since version V1.4.7 R414 it is no longer necessary to apply in relation to "non-encrypted e-mail addresses" the method shown here. The e-mail addresses are encrypted from this version in the value field in FE. | ||
| + | </note> | ||
| \\ | \\ | ||
| Line 42: | Line 45: | ||
| * The region is one of many and can be selected in a pull-down menu. The email address of the contact person is assigned. | * The region is one of many and can be selected in a pull-down menu. The email address of the contact person is assigned. | ||
| * It often happens that several regions will be managed by one person, thus stored identical email addresses. | * It often happens that several regions will be managed by one person, thus stored identical email addresses. | ||
| - | * In the text of the initial email the selected region are shown. | + | * In the text of the initial email the selected region is shown. |
| - | The last requirement excludes the use of the form from PHP function because we can not relate in a typical building a response to the selected region. //($postvar['email'] => test@example.com)// if e.g. | + | The last requirement will exclude the use of PHP function within the form because with a standard form setup we cannot build a feedback relation to the selected region. //($postvar['email'] => test@example.com)// if e.g. |
| **[select email menu]** Name: **email** | **[select email menu]** Name: **email** | ||
| Line 55: | Line 58: | ||
| </file> | </file> | ||
| - | If the user selects one of the first two places e.g. "Laudanum", an identical e-mail address is returned to us, we do not know which location the user selects. //(Obelix is responsible for both places)//. | + | If the user is selecting one of the first two places e.g. "Laudanum", an identical e-mail address is returned to us, we do not know which location the user has been selecting. //(Obelix is responsible for both places)//. |
| **Extended Version 2:** | **Extended Version 2:** | ||
| Line 61: | Line 64: | ||
| FIXME translate | FIXME translate | ||
| - | * Um den Fehlerfall und die Selektion zu ermöglichen verwenden wir ein einfaches Ausklappmenü. \\ Die Auswahl kann so in $postvar['ortsauswahl'] bestimmt werden. | + | * To catch all errors and enable us to make use of the selection we'll set up a simple pulldown menu. \\ Our selection can then be determined via $postvar['ortsauswahl']. |
| - | * Die Beziehung zwischen Ortsangabe und eMailadresse wird in dem versteckten Feld "ort_email" abgelegt (Variable $_POST['ort_email']). | + | * The relation between place and E-mail address will be stored in the hidden field "ort_email" (Variable $_POST['ort_email']). |
| - | * Für die Ausgabe des Ortes wird ein verstecktes Feld "ort" angelegt (Variable $_POST['ort']). | + | * For the output of the place we have to created a hidden field "ort" (Variable $_POST['ort']). |
| - | * Für die Ausgabe der eMailadresse wird ein E-Mail-Feld "email" angelegt (Variable $_POST['email']) um die "email" als Absender eintragen zu können. | + | * To enable the output of the eMail address we'll need to create an E-Mail field "email" (Variable $_POST['email']) to be able to fill in "email" as the sender address. |
| - | Meiner Ansicht nach müssen für das gewünschte Ergebnis 4 Felder angelegt werden //(siehe unten 1-4)//, da wir ein Eingabefeld //(in diesem Fall "ortsauswahl")// nicht während der wiederholten Eingabe //(Fehlerfall)// manipulieren dürfen. Die Session setzt sonst vorherige Eingabe zurück. \\ | + | To my opinion we have to create 4 fields to get the desired results //(see below, 1-4)// because we must not manipulate an input field //(in this case "ortsauswahl")// any further (accidentally) in case of repeated input //(case of error/reload)//, otherwise the session will reset an input made previously. \\ |
| - | Also wird ein einfaches Eingabefeld verwendet //(Artikelmenü)// das nicht durch das Script verändert wird. Die Zuordnung der eMailadresse zum gewählten Ort passiert im Script mit der Hilfe eines zweiten versteckten Feldes in dem diese Beziehung abgelegt ist. \\ | + | Therfore we'll make use of a simple input field //(Articlemenu)// which will not be changed through the script. The script will assign the eMail address to the chosen place with the help of s second hidden field where this relation is defined. \\ |
| - | Die eMailadresse ist unleserlich abgelegt um SPAM-Robotern keine Gelegenheit zu geben diese als solche auszulesen. //(Ort|Name*domain:tld# ---> Kleinbonum|obelix*lokal:arpa#)//. Das Zeichen # dient als Trenner der einzelnen Datensätze und muss angegeben werden. | + | This eMail address is stored fairly unreadable to prevent SPAM-bots from reading them. //(Ort|Name*domain:tld# ---> Kleinbonum|obelix*lokal:arpa#)//. The #- sign is used as a between the different data and has to be set. |
| - | Um den Ort im Ausgabetext zu verankern legen wir ein verstecktes Feld "ort" mit dem Inhalt "nix" an. Dieses Feld kann auch zur Identifikation des Formulars dienen, denn das frontend_init-Script wird bei jedem Seitenaufruf abgearbeitet! | + | To incorporate the "place" in an output text we are defining a new hidden field "ort" with "nix" as the content. This field can be used to identify the form, because the frontend_init-script will be run with every page call! |
| - | Die eMailadresse wird im Script in das Feld "email" übergeben und kann so optional auch als Absenderadresse im Formular eingetragen werden //(Mit versteckten Feldern geht das nicht)//. | + | The eMail address will be passed over to the field "email" and therefor can be used as the senders address also //(you vannot do that with hidden fields)//. |
| \\ | \\ | ||
| Line 84: | Line 87: | ||
| if( isset($_POST['ort']) AND isset($_POST['ort_email']) ) { ... | if( isset($_POST['ort']) AND isset($_POST['ort_email']) ) { ... | ||
| </code> | </code> | ||
| - | So kann das Formular zumindest rudimentär identifiziert werden. Dies kann bei mehreren Formularen in der Site wichtig sein. | + | This way you can identify the form basically. It will be possibly helpful when more than one form has to be used. |
| - | Der letzte Schritt ist die Filterung des Ortes und Zuweisung zur Variablen "$_POST['ort']" und "$_POST['email']". \\ | + | The only step missing is filtering the "place" and assigning it to the variable "$_POST['ort']" und "$_POST['email']". \\ |
| <code php |h form_script_email_to_location_v2.php |h> | <code php |h form_script_email_to_location_v2.php |h> | ||
| Line 141: | Line 144: | ||
| {{:deutsch:phpwcms-system:artikel:contentparts:formular:spezielle-anwendungen:php-script-u-funktion:php_script_und_funktion02_be01_de_1.gif|}} | {{:deutsch:phpwcms-system:artikel:contentparts:formular:spezielle-anwendungen:php-script-u-funktion:php_script_und_funktion02_be01_de_1.gif|}} | ||
| - | **[selelct menu]** Name: **ortsauswahl** | + | **[select menu]** Name: **ortsauswahl** |
| <code> | <code> | ||
| Bitte wählen-|- | Bitte wählen-|- | ||