Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:entwickler:zuruecknavigieren_mit_vorbelegten_feldern [2015/11/04 20:19] – created thomas-rcv | en:entwickler:zuruecknavigieren_mit_vorbelegten_feldern [2024/12/01 07:14] (current) – removed fasse | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Back navigation with preassigned fields ====== | ||
- | Once the PHP sessions are activated, the fields are no longer automatically preset by the browser, if you'll come back through a notification or other fields to a form. | ||
- | |||
- | This must now be programmed itself for each form. However, this also has the advantage that you can better respond to input errors. (For example, the unfilled box yellow or red highlighted, | ||
- | |||
- | Based on the maintenance dialog of the announcements the procedure will now be described: | ||
- | |||
- | The first thing you must secure these entries in a session variable at the beginning of // | ||
- | |||
- | Now, the contents must be processed in // | ||
- | |||
- | If you work here **with** a table class, so there is a very easy way to demonstrate the fields again: <code php> if(isset($_SESSION[' | ||
- | { | ||
- | foreach($_SESSION[' | ||
- | { | ||
- | if(strpos($key, | ||
- | { | ||
- | $announcement-> | ||
- | } | ||
- | } | ||
- | unset($_SESSION[' | ||
- | }</ | ||
- | |||
- | When working **without** Table access class must be removed the following: | ||
- | |||
- | For this purpose, you should create best practice for each field on the form a variable. If now **$ _ SESSION [' | ||
- | { | ||
- | $form_values = strStripSlashesDeep($_SESSION[' | ||
- | unset($_SESSION[' | ||
- | } | ||
- | else | ||
- | { | ||
- | $form_values[' | ||
- | $form_values[' | ||
- | $form_values[' | ||
- | if ($_GET[" | ||
- | { | ||
- | ... Reading the id - dataset and preassign the $field variable with the data from the database ... | ||
- | } | ||
- | }</ | ||
- | |||
- | |||
- | |||
- | However, you have to take in account, when to clear the variable **$_SESSION[' |