You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by vi...@apache.org on 2020/01/26 21:24:50 UTC

[netbeans-website] branch master updated: [NETBEANS-1870] WishList 4-9, WithList Oracle Lesson 1, Dead links removed from screencast pages

This is an automated email from the ASF dual-hosted git repository.

vieiro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f77348  [NETBEANS-1870] WishList 4-9, WithList Oracle Lesson 1, Dead links removed from screencast pages
5f77348 is described below

commit 5f773485c9f9c5cf5f5cde03376280b8450ce0b0
Author: Adam Sztefanov <sz...@gmail.com>
AuthorDate: Sun Jan 26 22:24:40 2020 +0100

    [NETBEANS-1870] WishList 4-9, WithList Oracle Lesson 1, Dead links removed from screencast pages
    
    * [NETBEANS-1870] Reviewing the Asciidoc of PHP tutorials
    
     * [php] wishlist-lesson4
    
    * [NETBEANS-1870] Reviewing the Asciidoc of PHP tutorials
    
     * [php] wishlist-lesson4
    
    * [NETBEANS-1870] Reviewing the Asciidoc of PHP tutorials
    
     * [php] wishlist-lesson5
     * [php] wishlist-lesson6
    
    *  [NETBEANS-1870]
    
     * [php] wishlist-lesson7
     * [php] wishlist-lesson8
     * [php] wishlist-lesson9
    
    * [NETBEANS-1870] Reviewing the Asciidoc of PHP tutorials
    
    * [php] dead links removed
---
 .../php/remote-hosting-and-ftp-account.asciidoc    |  10 +-
 .../php/remote-hosting-and-ftp-account_ja.asciidoc |   8 +-
 .../remote-hosting-and-ftp-account_pt_BR.asciidoc  |  10 +-
 .../php/remote-hosting-and-ftp-account_ru.asciidoc |  10 +-
 .../remote-hosting-and-ftp-account_zh_CN.asciidoc  |   6 +-
 .../content/kb/docs/php/screencast-apigen.asciidoc |   2 -
 .../docs/php/screencast-continuous-builds.asciidoc |   6 +-
 .../php/screencast-continuous-builds_ja.asciidoc   |   3 +-
 .../screencast-continuous-builds_pt_BR.asciidoc    |   3 +-
 .../php/screencast-continuous-builds_ru.asciidoc   |   3 +-
 .../screencast-continuous-builds_zh_CN.asciidoc    |   3 +-
 .../kb/docs/php/screencast-doctrine2.asciidoc      |   3 +-
 .../content/kb/docs/php/screencast-php54.asciidoc  |   5 +-
 .../content/kb/docs/php/screencast-phpdoc.asciidoc |   3 +-
 .../kb/docs/php/screencast-phpdoc_ja.asciidoc      |   3 +-
 .../kb/docs/php/screencast-phpdoc_pt_BR.asciidoc   |   5 +-
 .../kb/docs/php/screencast-phpdoc_ru.asciidoc      |   3 +-
 .../kb/docs/php/screencast-phpdoc_zh_CN.asciidoc   |   5 +-
 .../php/screencast-rename-refactoring.asciidoc     |   5 +-
 .../php/screencast-rename-refactoring_ja.asciidoc  |   5 +-
 .../screencast-rename-refactoring_pt_BR.asciidoc   |   4 +-
 .../php/screencast-rename-refactoring_ru.asciidoc  |   5 +-
 .../screencast-rename-refactoring_zh_CN.asciidoc   |   5 +-
 .../content/kb/docs/php/screencast-smarty.asciidoc |   5 +-
 .../kb/docs/php/screencast-smarty_ja.asciidoc      |   5 +-
 .../kb/docs/php/screencast-smarty_pt_BR.asciidoc   |   5 +-
 .../kb/docs/php/screencast-smarty_ru.asciidoc      |   5 +-
 .../kb/docs/php/screencast-smarty_zh_CN.asciidoc   |   5 +-
 .../content/kb/docs/php/wish-list-lesson4.asciidoc | 546 ++++++++++++---------
 .../kb/docs/php/wish-list-lesson4_ja.asciidoc      | 498 +++++++++++--------
 .../kb/docs/php/wish-list-lesson4_pt_BR.asciidoc   | 516 +++++++++++--------
 .../kb/docs/php/wish-list-lesson4_ru.asciidoc      | 473 +++++++++++-------
 .../kb/docs/php/wish-list-lesson4_zh_CN.asciidoc   | 477 +++++++++++-------
 .../content/kb/docs/php/wish-list-lesson5.asciidoc | 226 ++++-----
 .../kb/docs/php/wish-list-lesson5_ja.asciidoc      | 208 ++++----
 .../kb/docs/php/wish-list-lesson5_pt_BR.asciidoc   | 213 ++++----
 .../kb/docs/php/wish-list-lesson5_ru.asciidoc      | 210 ++++----
 .../kb/docs/php/wish-list-lesson5_zh_CN.asciidoc   | 211 ++++----
 .../content/kb/docs/php/wish-list-lesson6.asciidoc | 304 ++++++------
 .../kb/docs/php/wish-list-lesson6_ja.asciidoc      | 266 +++++-----
 .../kb/docs/php/wish-list-lesson6_pt_BR.asciidoc   | 283 ++++++-----
 .../kb/docs/php/wish-list-lesson6_ru.asciidoc      | 281 ++++++-----
 .../kb/docs/php/wish-list-lesson6_zh_CN.asciidoc   | 280 ++++++-----
 .../content/kb/docs/php/wish-list-lesson7.asciidoc | 270 +++++-----
 .../kb/docs/php/wish-list-lesson7_ja.asciidoc      | 252 ++++++----
 .../kb/docs/php/wish-list-lesson7_pt_BR.asciidoc   | 252 ++++++----
 .../kb/docs/php/wish-list-lesson7_ru.asciidoc      | 238 +++++----
 .../kb/docs/php/wish-list-lesson7_zh_CN.asciidoc   | 249 ++++++----
 .../content/kb/docs/php/wish-list-lesson8.asciidoc | 126 +++--
 .../kb/docs/php/wish-list-lesson8_ja.asciidoc      | 102 ++--
 .../kb/docs/php/wish-list-lesson8_pt_BR.asciidoc   | 100 ++--
 .../kb/docs/php/wish-list-lesson8_ru.asciidoc      | 107 ++--
 .../kb/docs/php/wish-list-lesson8_zh_CN.asciidoc   | 102 ++--
 .../content/kb/docs/php/wish-list-lesson9.asciidoc |  35 +-
 .../kb/docs/php/wish-list-lesson9_ja.asciidoc      |  54 +-
 .../kb/docs/php/wish-list-lesson9_pt_BR.asciidoc   |  45 +-
 .../kb/docs/php/wish-list-lesson9_ru.asciidoc      |  55 +--
 .../kb/docs/php/wish-list-lesson9_zh_CN.asciidoc   |  54 +-
 .../kb/docs/php/wish-list-oracle-lesson1.asciidoc  |  80 ++-
 .../docs/php/wish-list-oracle-lesson1_ja.asciidoc  |  71 +--
 .../php/wish-list-oracle-lesson1_pt_BR.asciidoc    |  76 +--
 .../docs/php/wish-list-oracle-lesson1_ru.asciidoc  |  72 +--
 .../php/wish-list-oracle-lesson1_zh_CN.asciidoc    |  72 +--
 .../kb/docs/php/zend-framework-screencast.asciidoc |   8 +-
 .../docs/php/zend-framework-screencast_ja.asciidoc |   2 +-
 .../php/zend-framework-screencast_pt_BR.asciidoc   |   8 +-
 .../docs/php/zend-framework-screencast_ru.asciidoc |   3 +-
 .../php/zend-framework-screencast_zh_CN.asciidoc   |   7 +-
 68 files changed, 4090 insertions(+), 3482 deletions(-)

diff --git a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account.asciidoc
index aa76e00..4aaa54d 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account.asciidoc
@@ -113,9 +113,9 @@ image::images/manageremoteconnections.png[]
 
 After you choose the remote connection for your project, select whether to upload your source files on run, on save, or manually.
 
-* *On Run:* Source files are uploaded to the server when you run the project.
-* *On Save: *Every change (create, edit, rename, delete) is immediately propagated to your remote server. If the operation takes more than 1 second, a progress bar is shown.
-* *Manually:* Files are never uploaded automatically. You must use the IDE's manual upload function, described in this section.
+*On Run:* Source files are uploaded to the server when you run the project.
+*On Save:* Every change (create, edit, rename, delete) is immediately propagated to your remote server. If the operation takes more than 1 second, a progress bar is shown.
+*Manually:* Files are never uploaded automatically. You must use the IDE's manual upload function, described in this section.
 
 image::images/ftp-run-config.png[]
 
@@ -137,9 +137,9 @@ image::images/upload-output.png[]
 
 For developers who must work over (S)FTP in multiple developer environments without proper version control, NetBeans IDE provides remote synchronization. Remote synchronization allows you to compare your local copy of project files with the copies on the (S)FTP server. You can upload your local copy to the server or download the server's copy to your local machine. When the copy on the server was updated after you began work on your local copy, NetBeans IDE warns you of a file conflict.  [...]
 
-*Warning: *Remote synchronization is never 100% reliable because the timestamps on FTP servers are not 100% reliable. Version control is a safer solution.
+*Warning:* Remote synchronization is never 100% reliable because the timestamps on FTP servers are not 100% reliable. Version control is a safer solution.
 
-*Caution: *Remote synchronization works more reliably when you perform it on an entire project. You can perform remote synchronization on individual files but this has higher risk.
+*Caution:* Remote synchronization works more reliably when you perform it on an entire project. You can perform remote synchronization on individual files but this has higher risk.
 
 *To perform remote synchronization:*
 
diff --git a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_ja.asciidoc
index 78eba24..ed358a9 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_ja.asciidoc
@@ -119,9 +119,9 @@ image::images/manageremoteconnections.png[]
 
 プロジェクトに対してリモート接続を選択した後、どの時点(実行時、保存時、または手動)でソース・ファイルをアップロードするかを選択します。
 
-* *実行時:* ソース・ファイルは、プロジェクトを実行するときにサーバーにアップロードされます。
-* *保存時:* すべての変更(作成、編集、名前変更、削除)は、リモート・サーバーにすぐに伝播されます。操作に1秒以上かかる場合は、進捗バーが表示されます。
-* *手動:* ファイルは自動的にアップロードされません。この項で説明する、IDEの手動アップロード機能を使用する必要があります。
+*実行時:* ソース・ファイルは、プロジェクトを実行するときにサーバーにアップロードされます。
+*保存時:* すべての変更(作成、編集、名前変更、削除)は、リモート・サーバーにすぐに伝播されます。操作に1秒以上かかる場合は、進捗バーが表示されます。
+*手動:* ファイルは自動的にアップロードされません。この項で説明する、IDEの手動アップロード機能を使用する必要があります。
 
 image::images/ftp-run-config.png[]
 
@@ -143,7 +143,7 @@ image::images/upload-output.png[]
 
 開発者が適切なバージョン管理をせずに複数の開発者環境でFTPまたはSFTPを操作する必要がある場合、NetBeans IDEではリモート同期が提供されます。リモート同期を使用すると、プロジェクト・ファイルのローカル・コピーを、FTPまたはSFTPサーバー上のコピーと比較できます。ローカル・コピーをサーバーにアップロードしたり、サーバーのコピーをローカル・マシンにダウンロードできます。ローカル・コピーで作業を開始した後にサーバー上のコピーが更新された場合、NetBeans IDEによって、ファイルの競合があることが警告されます。ファイルの競合がある場合は、NetBeans IDEを使用して、ローカル・バージョンとサーバー上のバージョンとの差分を取得し、行ごとにどちらのバージョンを使用するかを決定できます。
 
-*警告: *FTPサーバーのタイムスタンプは100%信頼できるわけではないため、リモート同期も100%信頼できるわけではありません。安全な解決策はバージョン管理です。
+*警告:* FTPサーバーのタイムスタンプは100%信頼できるわけではないため、リモート同期も100%信頼できるわけではありません。安全な解決策はバージョン管理です。
 
 NOTE: プロジェクト全体でリモート同期を実行すると、信頼性がより向上します。個別のファイルに対してリモート同期を実行できますが、リスクが高くなります。
 
diff --git a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_pt_BR.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_pt_BR.asciidoc
index 6e8f6ae..5dd2970 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_pt_BR.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_pt_BR.asciidoc
@@ -119,9 +119,9 @@ image::images/manageremoteconnections.png[]
 
 Após você escolher a conexão remota para seu projeto, selecione se deseja fazer upload dos seus arquivos de código-fonte na execução, ao salvar ou manualmente.
 
-* *Ao Executar:* os arquivos de Código-Fonte terão upload no servidor quando o projeto for executado.
-* *Ao salvar: *qualquer alteração (criar, editar, renomear, deletar) será imediatamente propagada para seu servidor remoto. Se a operação levar mais de 1 segundo, uma barra de andamento será mostrada.
-* *Manualmente:* os arquivos nunca terão upload automático. É preciso utilizar a função de upload do IDE, descrita nesta seção.
+*Ao Executar:* os arquivos de Código-Fonte terão upload no servidor quando o projeto for executado.
+*Ao salvar:* qualquer alteração (criar, editar, renomear, deletar) será imediatamente propagada para seu servidor remoto. Se a operação levar mais de 1 segundo, uma barra de andamento será mostrada.
+*Manualmente:* os arquivos nunca terão upload automático. É preciso utilizar a função de upload do IDE, descrita nesta seção.
 
 image::images/ftp-run-config.png[]
 
@@ -143,9 +143,9 @@ image::images/upload-output.png[]
 
 Para os desenvolvedores que tiverem que trabalhar em (S)FTP em ambientes de vários desenvolvedores sem o controle de versão adequado, o NetBeans IDE fornece sincronização remota. A sincronização remota permite comparar a cópia local dos arquivos do projeto com as cópias no servidor (S)FTP. Você pode fazer upload da cópia local no servidor ou fazer download da cópia do servidor na máquina local. Quando a cópia no servidor tiver sido atualizada depois de você ter começado a trabalhar na có [...]
 
-*Advertência: *a sincronização remota nunca é 100% confiável porque os timestamps nos servidores FTP não são 100% confiáveis. O controle de versão é uma solução mais segura.
+*Advertência:* a sincronização remota nunca é 100% confiável porque os timestamps nos servidores FTP não são 100% confiáveis. O controle de versão é uma solução mais segura.
 
-*Cuidado: *a sincronização remota trabalha de maneira mais confiável quando você a executa em um projeto inteiro. Você pode executar a sincronização remota em arquivos individuais, mas aí o risco é mais alto.
+*Cuidado:* a sincronização remota trabalha de maneira mais confiável quando você a executa em um projeto inteiro. Você pode executar a sincronização remota em arquivos individuais, mas aí o risco é mais alto.
 
 *Para executar a sincronização remota:*
 
diff --git a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_ru.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_ru.asciidoc
index 3842562..ac41cdd 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_ru.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_ru.asciidoc
@@ -119,9 +119,9 @@ image::images/manageremoteconnections.png[]
 
 После выбора удаленного подключения для проекта выберите способ загрузки исходных файлов на сервер: при выполнении, при сохранении или вручную.
 
-* *При выполнении:* исходные файлы загружаются на сервер при выполнении проекта.
-* *При сохранении:* каждое изменение (создание, правка, переименование, удаление) немедленно воспроизводится на удаленном сервере. Если операция занимает более 1 секунды, отображается индикатор выполнения.
-* *Вручную:* автоматическая загрузка файлов не выполняется. В этом случае следует пользоваться функцией загрузки в ручном режиме, описанной в данном разделе.
+*При выполнении:* исходные файлы загружаются на сервер при выполнении проекта.
+*При сохранении:* каждое изменение (создание, правка, переименование, удаление) немедленно воспроизводится на удаленном сервере. Если операция занимает более 1 секунды, отображается индикатор выполнения.
+*Вручную:* автоматическая загрузка файлов не выполняется. В этом случае следует пользоваться функцией загрузки в ручном режиме, описанной в данном разделе.
 
 image::images/ftp-run-config.png[]
 
@@ -143,9 +143,9 @@ image::images/upload-output.png[]
 
 Разработчики, которым необходимо использовать (S)FTP в нескольких средах разработки без правильной версии системы управления версиями IDE NetBeans обеспечивает удаленную синхронизацию. Удаленная синхронизация позволяет сравнить локальную копию файлов проекта с копиями на сервере (S)FTP. Вы можете загрузить локальные копии на сервер или загрузить копию с сервера на локальный компьютер. При обновлении копии на сервере после начала работы с локальной копией в IDE NetBeans создается предупре [...]
 
-*Предупреждение. *Удаленная синхронизация никогда не бывает надежной на 100%, поскольку временные метки FTP-серверах не являются надежными на 100%. Системы контроля версиями являются более безопасном решением.
+*Предупреждение.* Удаленная синхронизация никогда не бывает надежной на 100%, поскольку временные метки FTP-серверах не являются надежными на 100%. Системы контроля версиями являются более безопасном решением.
 
-*Внимание! *Удаленная синхронизация работает более надежно, когда она выполняется для всего проекта. Вы можете выполнять удаленную синхронизацию отдельных файлов, но риск при этом выше.
+*Внимание!* Удаленная синхронизация работает более надежно, когда она выполняется для всего проекта. Вы можете выполнять удаленную синхронизацию отдельных файлов, но риск при этом выше.
 
 *Выполнение удаленной синхронизации*
 
diff --git a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_zh_CN.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_zh_CN.asciidoc
index bbb4acf..ebc4f1a 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_zh_CN.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/remote-hosting-and-ftp-account_zh_CN.asciidoc
@@ -116,9 +116,9 @@ image::images/manageremoteconnections.png[]
 
 为项目选择远程连接后,请选择是在运行时、保存时还是手动上载源文件。
 
-* *运行时:*在运行项目时将源文件上载到服务器。
-* *保存时:*将每项更改(创建、编辑、重命名、删除)立即传播到远程服务器。如果该操作用时超过 1 秒,则将显示一个进度栏。
-* *手动:*从不自动上载文件。您必须使用此部分介绍的 IDE 的手动上载功能。
+*运行时:*在运行项目时将源文件上载到服务器。
+*保存时:*将每项更改(创建、编辑、重命名、删除)立即传播到远程服务器。如果该操作用时超过 1 秒,则将显示一个进度栏。
+*手动:*从不自动上载文件。您必须使用此部分介绍的 IDE 的手动上载功能。
 
 image::images/ftp-run-config.png[]
 
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-apigen.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-apigen.asciidoc
index 880cd7d..a79a0d7 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-apigen.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-apigen.asciidoc
@@ -38,6 +38,4 @@ Author: Jeff Rubinoff
 Time: 7:22 
 link:http://bits.netbeans.org/media/php-apigen.flv[+Download+] [17.5 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: ApiGen Screencast[+Send Feedback on This Tutorial+]
- |  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds.asciidoc
index dd7907c..44df8c6 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds.asciidoc
@@ -33,9 +33,9 @@
 |This screencast shows how to set up PHP applications on Hudson and Jenkins continuous build servers. It includes an overview of what continuous builds are and why they can be useful with PHP applications. The screencast also shows how to launch a build job for a PHP application and how to access the results.
 
 Author: Jeff Rubinoff
-Time: 9:21 
+Time: 9:21
+
 link:http://bits.netbeans.org/media/php-continuous-builds.flv[+Download+] [21.7 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback:%20PHP%20Continuous%20Builds%20Screencast[+Send Feedback on This Tutorial+]
- |  
+
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_ja.asciidoc
index c08e7e6..3e63cb2 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_ja.asciidoc
@@ -34,8 +34,7 @@
 
 作成者: Jeff Rubinoff
 時間: 9:21
+
 link:http://bits.netbeans.org/media/php-continuous-builds.flv[+ダウンロード+] (21.7MB)
 
-link:/about/contact_form.html?to=3&subject=Feedback:%20PHP%20Continuous%20Builds%20Screencast[+このチュートリアルに関するご意見をお寄せください+]
- |  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_pt_BR.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_pt_BR.asciidoc
index 1d35fae..ea177f7 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_pt_BR.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_pt_BR.asciidoc
@@ -34,8 +34,7 @@
 
 Autor: Jeff Rubinoff
 Hora: 9:21 
+
 link:http://bits.netbeans.org/media/php-continuous-builds.flv[+Download+] [21.7 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback:%20PHP%20Continuous%20Builds%20Screencast[+Enviar Feedback neste Tutorial+]
- |  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_ru.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_ru.asciidoc
index b70b479..22aa0fb 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_ru.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_ru.asciidoc
@@ -34,8 +34,7 @@
 
 Автор: Джеф Рубинов (Jeff Rubinoff)
 Время: 9:21 
+
 link:http://bits.netbeans.org/media/php-continuous-builds.flv[+Загрузить+] [21,7 МБ]
 
-link:/about/contact_form.html?to=3&subject=Feedback:%20PHP%20Continuous%20Builds%20Screencast[+Отправить отзыв по этому учебному курсу+]
- |  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_zh_CN.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_zh_CN.asciidoc
index 93c7fdf..e64ca62 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_zh_CN.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-continuous-builds_zh_CN.asciidoc
@@ -34,8 +34,7 @@
 
 作者:Jeff Rubinoff
 播放时长:9:21 
+
 link:http://bits.netbeans.org/media/php-continuous-builds.flv[+下载+] [21.7 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback:%20PHP%20Continuous%20Builds%20Screencast[+发送有关此教程的反馈意见+]
- |  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-doctrine2.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-doctrine2.asciidoc
index 349f35e..0294ed6 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-doctrine2.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-doctrine2.asciidoc
@@ -39,8 +39,7 @@
 
 Author: Jeff Rubinoff
 Time: 11:21 
+
 link:http://bits.netbeans.org/media/php-doctrine2.flv[+Download+] [23.6 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback:%20Doctrine%202%20Screencast[+Send Feedback on This Tutorial+]
- |  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-php54.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-php54.asciidoc
index bac81fb..e9dc1e5 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-php54.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-php54.asciidoc
@@ -34,8 +34,7 @@
 
 Author: Jeff Rubinoff
 Time: 11:52 
-link:http://bits.netbeans.org/media/php54.flv[+Download+] [24.4 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback:%20PHP%205.4%20Screencast[+Send Feedback on This Tutorial+]
- |  
+link:http://bits.netbeans.org/media/php54.flv[+Download+] [24.4 MB]
+ 
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc.asciidoc
index 9c38262..28320f5 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc.asciidoc
@@ -36,8 +36,7 @@
 
 Author: Jeff Rubinoff
 Time: 7:11 
+
 link:http://bits.netbeans.org/media/phpdoc.flv[+Download+] [16.0 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHPDoc Screencast[+Send Feedback on This Tutorial+]
- |   
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_ja.asciidoc
index 1a766d9..8420bbc 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_ja.asciidoc
@@ -36,8 +36,7 @@
 
 作成者: Jeff Rubinoff
 時間: 7:11
+
 link:http://bits.netbeans.org/media/phpdoc.flv[+ダウンロード+] (16.0MB)
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHPDoc Screencast[+このチュートリアルに関するご意見をお寄せください+]
- |   
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_pt_BR.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_pt_BR.asciidoc
index b737c56..2edd6b6 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_pt_BR.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_pt_BR.asciidoc
@@ -36,8 +36,7 @@
 
 Autor: Jeff Rubinoff
 Duração: 7:11 
+
 link:http://bits.netbeans.org/media/phpdoc.flv[+Download+] [16.0 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHPDoc Screencast[+Enviar Feedback neste Tutorial+]
- |   
-|===
+|===
\ No newline at end of file
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_ru.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_ru.asciidoc
index 38b4220..317f0cf 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_ru.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_ru.asciidoc
@@ -36,8 +36,7 @@
 
 Автор: Джеф Рубинов (Jeff Rubinoff)
 Продолжительность: 7:11 
+
 link:http://bits.netbeans.org/media/phpdoc.flv[+Загрузить+] [16 МБ]
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHPDoc Screencast[+Отправить отзыв по этому учебному курсу+]
- |   
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_zh_CN.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_zh_CN.asciidoc
index b14802f..802408c 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_zh_CN.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-phpdoc_zh_CN.asciidoc
@@ -36,8 +36,7 @@
 
 作者:Jeff Rubinoff
 播放时长:7:11 
-link:http://bits.netbeans.org/media/phpdoc.flv[+下载+] [16.0 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHPDoc Screencast[+发送有关此教程的反馈意见+]
- |   
+link:http://bits.netbeans.org/media/phpdoc.flv[+下载+] [16.0 MB]
+ 
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring.asciidoc
index 4415626..4d4acac 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring.asciidoc
@@ -39,8 +39,7 @@
 
 Author: Jeff Rubinoff
 Time: 8:47 
-link:http://bits.netbeans.org/media/rename-refactoring.flv[+Download+] [18.3 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHP Rename Refactoring Screencast[+Send Feedback on This Tutorial+]
- |   
+link:http://bits.netbeans.org/media/rename-refactoring.flv[+Download+] [18.3 MB]
+  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_ja.asciidoc
index f980f4c..9cb001d 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_ja.asciidoc
@@ -39,8 +39,7 @@
 
 作成者: Jeff Rubinoff
 時間: 8:47
-link:http://bits.netbeans.org/media/rename-refactoring.flv[+ダウンロード+] (18.3MB)
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHP Rename Refactoring Screencast[+このチュートリアルに関するご意見をお寄せください+]
- |   
+link:http://bits.netbeans.org/media/rename-refactoring.flv[+ダウンロード+] (18.3MB)
+ 
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_pt_BR.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_pt_BR.asciidoc
index 8a493b7..7b8383e 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_pt_BR.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_pt_BR.asciidoc
@@ -40,7 +40,5 @@
 Autor: Jeff Rubinoff
 Hora: 8:47 
 link:http://bits.netbeans.org/media/rename-refactoring.flv[+Download+] [18.3 MB]
-
-link:/about/contact_form.html?to=3&subject=Feedback: PHP Rename Refactoring Screencast[+Enviar Feedback neste Tutorial+]
- |   
+ 
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_ru.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_ru.asciidoc
index 567c076..cded7d9 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_ru.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_ru.asciidoc
@@ -39,8 +39,7 @@
 
 Автор: Джеф Рубинов (Jeff Rubinoff)
 Продолжительность: 8:47 
-link:http://bits.netbeans.org/media/rename-refactoring.flv[+Загрузить+] [18,3 МБ]
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHP Rename Refactoring Screencast[+Отправить отзыв по этому учебному курсу+]
- |   
+link:http://bits.netbeans.org/media/rename-refactoring.flv[+Загрузить+] [18,3 МБ]
+   
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_zh_CN.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_zh_CN.asciidoc
index 4c72f25..6fc70d0 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_zh_CN.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-rename-refactoring_zh_CN.asciidoc
@@ -39,8 +39,7 @@
 
 作者:Jeff Rubinoff
 播放时长:8:47 
-link:http://bits.netbeans.org/media/rename-refactoring.flv[+下载+] [18.3MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: PHP Rename Refactoring Screencast[+发送有关此教程的反馈意见+]
- |   
+link:http://bits.netbeans.org/media/rename-refactoring.flv[+下载+] [18.3MB]
+  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty.asciidoc
index d0d21aa..f19e3a3 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty.asciidoc
@@ -40,8 +40,7 @@
 
 Author: Jeff Rubinoff
 Time: 6:44 
-link:http://bits.netbeans.org/media/smarty-framework.flv[+Download+] [16.2 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: Smarty Screencast[+Send Feedback on This Tutorial+]
- |   
+link:http://bits.netbeans.org/media/smarty-framework.flv[+Download+] [16.2 MB]
+  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_ja.asciidoc
index 343cf1a..e2eec5c 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_ja.asciidoc
@@ -40,8 +40,7 @@
 
 作成者: Jeff Rubinoff
 時間: 6:44
-link:http://bits.netbeans.org/media/smarty-framework.flv[+ダウンロード+] (16.2MB)
 
-link:/about/contact_form.html?to=3&subject=Feedback: Smarty Screencast[+このチュートリアルに関するご意見をお寄せください+]
- |   
+link:http://bits.netbeans.org/media/smarty-framework.flv[+ダウンロード+] (16.2MB)
+  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_pt_BR.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_pt_BR.asciidoc
index bcb3e00..20afcdf 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_pt_BR.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_pt_BR.asciidoc
@@ -40,8 +40,7 @@
 
 Autor: Jeff Rubinoff
 Hora: 6:44 
-link:http://bits.netbeans.org/media/smarty-framework.flv[+Download+] [16.2 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: Smarty Screencast[+Enviar Feedback neste Tutorial+]
- |   
+link:http://bits.netbeans.org/media/smarty-framework.flv[+Download+] [16.2 MB]
+ 
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_ru.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_ru.asciidoc
index aa2e001..26d74d8 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_ru.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_ru.asciidoc
@@ -40,8 +40,7 @@
 
 Автор: Джеф Рубинов (Jeff Rubinoff)
 Продолжительность: 6:44 
-link:http://bits.netbeans.org/media/smarty-framework.flv[+Загрузить+] [16,2 МБ]
 
-link:/about/contact_form.html?to=3&subject=Feedback: Smarty Screencast[+Отправить отзыв по этому учебному курсу+]
- |   
+link:http://bits.netbeans.org/media/smarty-framework.flv[+Загрузить+] [16,2 МБ]
+   
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_zh_CN.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_zh_CN.asciidoc
index b19ffd6..fe9a116 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_zh_CN.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/screencast-smarty_zh_CN.asciidoc
@@ -40,8 +40,7 @@
 
 作者:Jeff Rubinoff
 播放时长:6:44 
-link:http://bits.netbeans.org/media/smarty-framework.flv[+下载+] [16.2 MB]
 
-link:/about/contact_form.html?to=3&subject=Feedback: Smarty Screencast[+发送有关此教程的反馈意见+]
- |   
+link:http://bits.netbeans.org/media/smarty-framework.flv[+下载+] [16.2 MB]
+  
 |===
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4.asciidoc
index e1a0ebc..b73078d 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4.asciidoc
@@ -40,60 +40,26 @@
 :description: Lesson 4: Optimizing the Code with Classes and Objects - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, Lesson 4: Optimizing the Code with Classes and Objects
 
+In this lesson you optimize the code to facilitate maintaining it in the future. This affects the files  `createNewWisher.php`  and  `wishlist.php` . Additionally, a new file called  `db.php`  is created.
 
-Tutorial contents:
-
-1. link:wish-list-tutorial-main-page.html[+Creating a Database Driven Application With PHP - Main page+]
-2. 
-Creating the Database
-
-1. link:wish-list-lesson1.html[+Creating a MySQL Database+]
-2. link:wish-list-oracle-lesson1.html[+Creating Oracle Database Tables+]
-3. link:wish-list-lesson2.html[+Designing the Application. Reading from the Database +]
-4. link:wish-list-lesson3.html[+Creating a New Application User+]
-5. 
-*=> Optimizing the Code*
-
-* <<previousLessonSourceCode,Application Source Code from the Previous Lesson>>
-* <<createDbPhpFile,Creating the db.php File>>
-* <<wishDBClass,Creating the WishDB Class>>
-* <<instantiate-wishdb,Instantiating the WishDB Class>>
-* <<wishdb-constructor,Adding a Constructor to the WishDB Class>>
-* <<includedFunctions,Functions in the WishDB Class>>
-* <<getIDByName,Function get_wisherID_by_name>>
-* <<getWishesByID,Function get_wishes_by_wisher_id>>
-* <<createWisher,Function create_wisher>>
-* <<refactoring,Refactoring Your Application Code>>
-* <<refactoringWishlistFile,Refactoring the wishlist.php File>>
-* <<refactoringCreateNewWisher,Refactoring the createNewWisher.php File>>
-* <<lessonResultSourceCode,Application Source Code after the Current Lesson Is Completed>>
-6. link:wish-list-lesson5.html[+Adding Security. Implementing Application User Logon+]
-7. link:wish-list-lesson6.html[+Adding a New Wish to the Database+]
-8. link:wish-list-lesson7.html[+Updating and Deleting Entries in the Database+]
-9. link:wish-list-lesson8.html[+Making the Application Look Better Using the CSS Technology+]
-10. link:wish-list-lesson9.html[+Deploying the Application on a Remote Web Server+]
-
-In this lesson you optimize the code to facilitate maintaining it in the future. This affects the files  ``createNewWisher.php``  and  ``wishlist.php`` . Additionally, a new file called  ``db.php``  is created.
-
-Your application's code contains several similar blocks with queries to the database. To make the code easier to read and maintain in the future, you can extract these blocks, implement them as functions of a separate class called  ``WishDB`` , and place  ``WishDB``  in  ``db.php`` . Afterwards you can include the  ``db.php``  file in any PHP file and use any <<includedFunctions,function from WishDB>> without code duplication. Such an approach ensures that any changes to queries or funct [...]
-
-When you use a function from WishDB, you do not change the value of any of WishDB's variables. Instead, you use the WishDB class as a blueprint for creating an object of WishDB, and you change the values of variables in that object. When you finish working with that object, it is destroyed. Because the values of the WishDB class itself are never changed, you can reuse the class an unlimited number of times. In some cases you may want to have multiple instances of a class in existance at  [...]
+Your application's code contains several similar blocks with queries to the database. To make the code easier to read and maintain in the future, you can extract these blocks, implement them as functions of a separate class called  `WishDB` , and place  `WishDB`  in  `db.php` . Afterwards you can include the  `db.php`  file in any PHP file and use any <<includedFunctions,function from WishDB>> without code duplication. Such an approach ensures that any changes to queries or functions wil [...]
+
+When you use a function from WishDB, you do not change the value of any of WishDB's variables. Instead, you use the WishDB class as a blueprint for creating an object of WishDB, and you change the values of variables in that object. When you finish working with that object, it is destroyed. Because the values of the WishDB class itself are never changed, you can reuse the class an unlimited number of times. In some cases you may want to have multiple instances of a class in existence at  [...]
 
 Note that the term for creating an object of a class is "instantiating" that class, and that another word for an object is an "instance" of a class. The general term for programming with classes and objects is "object-oriented programming," or OOP. PHP 5 uses a sophisticated OOP model. See link:http://us3.php.net/zend-engine-2.php[+php.net+] for more information.
 
-In this tutorial, you move the database call functionality from individual PHP files to the WishDB class. Users of MySQL also replace the procedural-style  ``mysqli``  calls with object-oriented calls. This is in keeping with new, object-oriented design of the application
+In this tutorial, you move the database call functionality from individual PHP files to the WishDB class. Users of MySQL also replace the procedural-style  `mysqli`  calls with object-oriented calls. This is in keeping with new, object-oriented design of the application
 
 The current document is a part of the Creating a CRUD Application in the NetBeans IDE for PHP tutorial.
 
-
-
+[[previousLessonSourceCode]]
 == Application Source Code from the Previous Lesson
 
 MySQL users: Click link:https://netbeans.org/files/documents/4/1929/lesson3.zip[+here+] to download the source code that reflects the project state after the previous lesson is completed.
 
 Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson3.zip[+here+] to download the source code that reflects the project state after the previous lesson is completed.
 
-
+[[createDbPhpFile]]
 == Creating the db.php File
 
 Create a new subfolder in the Source Files folder. Name the folder Includes. Create a new file named db.php and place it in Includes. Later you can add more files to this folder that will be included in other PHP files.
@@ -106,82 +72,92 @@ Create a new subfolder in the Source Files folder. Name the folder Includes. Cre
 4. In the File Name field, type db. Then click Finish.
 
 
+[[wishDBClass]]
 == Creating the WishDB Class
 
-To create the WishDB class, you need to initialize the variables of the class and implement a constructor of the class. MySQL users please note that the WishDB class _extends_  ``mysqli`` . This means that WishDB _inherits_ the functions and other characteristics of the PHP mysqli class. You will see the importance of this when you add  ``mysqli `` functions to the class.
+To create the WishDB class, you need to initialize the variables of the class and implement a constructor of the class. MySQL users please note that the WishDB class _extends_  `mysqli` . This means that WishDB _inherits_ the functions and other characteristics of the PHP mysqli class. You will see the importance of this when you add  `mysqli ` functions to the class.
 
-Open the file db.php and create the WishDB class. In the class, declare database configuration variables for storing the name and password of the database owner (user), the name of the database, and the database host. All these variable declarations are "private," meaning that the initial values in the declarations cannot be accessed from outside the WishDB class (See link:http://us3.php.net/manual/en/language.oop5.visibility.php[+php.net+]). You also declare the private _ static_  ``$in [...]
+Open the file db.php and create the WishDB class. In the class, declare database configuration variables for storing the name and password of the database owner (user), the name of the database, and the database host. All these variable declarations are "private," meaning that the initial values in the declarations cannot be accessed from outside the WishDB class (See link:http://us3.php.net/manual/en/language.oop5.visibility.php[+php.net+]). You also declare the private _ static_  `$ins [...]
 
 *For MySQL Database:*
 
-
-[source,java]
+[source,php]
 ----
 
 class WishDB extends mysqli {
 
-
     // single instance of self shared among all instances
     private static $instance = null;
 
-
     // db connection config vars
     private $user = "phpuser";
     private $pass = "phpuserpw";
     private $dbName = "wishlist";
     private $dbHost = "localhost";
+
 }
-----
 
-*For Oracle Database: *
+----
 
+*For Oracle Database:*
 
-[source,java]
+[source,php]
 ----
 
-class WishDB {// single instance of self shared among all instances
-private static $instance = null;// db connection config vars
-private $user = "phpuser";
-private $pass = "phpuserpw";
-private $dbName = "wishlist";
-private $dbHost = "localhost/XE";
-private $con = null;}        
-----
+class WishDB {
 
+    // single instance of self shared among all instances
+    private static $instance = null;
+
+    // db connection config vars
+    private $user = "phpuser";
+    private $pass = "phpuserpw";
+    private $dbName = "wishlist";
+    private $dbHost = "localhost/XE";
+    private $con = null;
+
+}
+
+----
 
 [[instantiate-wishdb]]
 == Instantiating the WishDB class
 
-For other PHP files to use functions in the WishDB class, these PHP files need to call a function that creates an object of ("instantiates") the WishDB class. WishDB is designed as a link:http://www.phpclasses.org/browse/package/1151.html[+singleton class+], meaning that only one instance of the class is in existance at any one time. It is therefore useful to prevent any external instantiation of WishDB, which could create duplicate instances.
+For other PHP files to use functions in the WishDB class, these PHP files need to call a function that creates an object of ("instantiates") the WishDB class. WishDB is designed as a link:http://www.phpclasses.org/browse/package/1151.html[+singleton class+], meaning that only one instance of the class is in existence at any one time. It is therefore useful to prevent any external instantiation of WishDB, which could create duplicate instances.
 
 Inside the WishDB class, type or paste the following code:
 
-
-[source,java]
+[source,php]
 ----
 
- //This method must be static, and must return an instance of the object if the object
- //does not already exist.
- public static function getInstance() {
-   if (!self::$instance instanceof self) {
-     self::$instance = new self;
-   }
-   return self::$instance;
- }
+// This method must be static, and must return an instance of the object if the object
+// does not already exist.
+
+public static function getInstance() {
+
+  if (!self::$instance instanceof self) {
+    self::$instance = new self;
+  }
+
+  return self::$instance;
+}
+
+// The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
+// thus eliminating the possibility of duplicate objects.
+ 
+public function __clone() {
+  trigger_error('Clone is not allowed.', E_USER_ERROR);
+}
+
+public function __wakeup() {
+  trigger_error('Deserializing is not allowed.', E_USER_ERROR);
+}
 
- // The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
- // thus eliminating the possibility of duplicate objects.
- public function __clone() {
-   trigger_error('Clone is not allowed.', E_USER_ERROR);
- }
- public function __wakeup() {
-   trigger_error('Deserializing is not allowed.', E_USER_ERROR);
- }
 ----
 
-The  ``getInstance``  function is "public" and "static." "Public" means that it can be freely accessed from outside the class. "Static" means that the function is available even when the class has not been instantiated. As the  ``getInstance``  function is called to instantiate the class, it must be static. Note that this function accesses the static  ``$instance``  variable and sets its value as the instance of the class.
+The  `getInstance`  function is "public" and "static." "Public" means that it can be freely accessed from outside the class. "Static" means that the function is available even when the class has not been instantiated. As the  `getInstance`  function is called to instantiate the class, it must be static. Note that this function accesses the static  `$instance`  variable and sets its value as the instance of the class.
 
-The double-colon (::), called the Scope Resolution Operator, and the  ``self``  keyword are used to access static functions.  ``Self``  is used from within the class definition to refer to the class itself. When the double-colon is used from outside the class definition, the name of the class is used instead of  ``self`` . See link:http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php[+php.net on the Scope Resolution Operator+].
+The double-colon (::), called the Scope Resolution Operator, and the  `self`  keyword are used to access static functions.  `Self`  is used from within the class definition to refer to the class itself. When the double-colon is used from outside the class definition, the name of the class is used instead of  `self` . See link:http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php[+php.net on the Scope Resolution Operator+].
 
 
 [[wishdb-constructor]]
@@ -194,32 +170,46 @@ Add the following code to WishDB:
 *For the MySQL database:*
 
 
-[source,java]
+[source,php]
 ----
 
-// private constructorprivate function __construct() {parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);if (mysqli_connect_error()) {exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());}parent::set_charset('utf-8');}
+// private constructor
+private function __construct() {
+
+  parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);
+  
+  if (mysqli_connect_error()) {
+    exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
+  }
+
+  parent::set_charset('utf-8');
+}
+
 ----
 
 *For the Oracle database:*
 
 
-[source,java]
+[source,php]
 ----
 
 // private constructor
 private function __construct() {
+
     $this->con = oci_connect($this->user, $this->pass, $this->dbHost);
+
     if (!$this->con) {
         $m = oci_error();
         echo $m['message'], "\n";
         exit;
     }
 }
-----
 
-Note the use of the pseudovariable  ``$this``  instead of the variables  ``$con`` ,  ``$dbHost`` ,  ``$user`` , or  ``$pass`` . The pseudovariable  ``$this``  is used when a method is called from within an object context. It refers to the value of a variable within that object.
+----
 
+Note the use of the pseudovariable  `$this`  instead of the variables  `$con` ,  `$dbHost` ,  `$user` , or  `$pass` . The pseudovariable  `$this`  is used when a method is called from within an object context. It refers to the value of a variable within that object.
 
+[[includedFunctions]]
 == Functions in the WishDB Class
 
 In this lesson you will implement the following functions of the WishDB class:
@@ -228,7 +218,7 @@ In this lesson you will implement the following functions of the WishDB class:
 * <<getWishesByID,get_wishes_by_wisher_id>> for retrieving a list of wishes of the wisher with a specific id
 * <<createWisher,create_wisher>> for adding a new wisher record to the table wishers
 
-
+[[getIDByName]]
 === Function get_wisher_id_by_name
 
 The function requires the name of a wisher as the input parameter and returns the wisher's id. 
@@ -238,34 +228,56 @@ Type or paste the following function into the WishDB class, after the WishDB fun
 *For the MySQL database:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function get_wisher_id_by_name($name) {$name = $this->real_escape_string($name);$wisher = $this->query("SELECT id FROM wishers WHERE name = '". $name . "'");
-    if ($wisher->num_rows > 0){$row = $wisher->fetch_row();return $row[0];} elsereturn null;
+public function get_wisher_id_by_name($name) {
+  
+  $name = $this->real_escape_string($name);
+  $wisher = $this->query("SELECT id FROM wishers WHERE name = '" . $name . "'");
+
+  if ($wisher->num_rows > 0){
+    $row = $wisher->fetch_row();
+    return $row[0];
+  } else {
+    return null;
+  }
 }
+
 ----
 
 *For the Oracle database:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wisher_id_by_name($name) {
+    
     $query = "SELECT id FROM wishers WHERE name = :user_bv";
     $stid = oci_parse($this->con, $query);
+    
     oci_bind_by_name($stid, ':user_bv', $name);
     oci_execute($stid);
-//Because user is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);if ($row) return $row["ID"];elsereturn null;
+    
+    //Because user is a unique value I only expect one row
+    $row = oci_fetch_array($stid, OCI_ASSOC);
+
+    if ($row) {
+      return $row["ID"];
+    } else {
+      return null;
+    }
 }
+
 ----
-The code block executes the query  ``SELECT ID FROM wishers WHERE name = [variable for name of the wisher]`` . The query result is an array of IDs from the records that meet the query. If the array is not empty this automatically means that it contains one element because the field name is specified as UNIQUE during the table creation. In this case the function returns the first element of the  ``$result``  array (the element with the zero numbered). If the array is empty the function re [...]
 
-*Security Note:* For the MySQL database, the  ``$name `` string is escaped in order to prevent SQL injection attacks. See link:http://en.wikipedia.org/wiki/SQL_injection[+Wikipedia on SQL injections+] and the link:http://us3.php.net/mysql_real_escape_string[+mysql_real_escape_string documentation+]. Although in the context of this tutorial you are not at risk of harmful SQL injections, it is best practice to escape strings in MySQL queries that would be at risk of such an attack. The Ora [...]
+The code block executes the query  `SELECT ID FROM wishers WHERE name = [variable for name of the wisher]` . The query result is an array of IDs from the records that meet the query. If the array is not empty this automatically means that it contains one element because the field name is specified as UNIQUE during the table creation. In this case the function returns the first element of the  `$result`  array (the element with the zero numbered). If the array is empty the function returns null.
+
+*Security Note:* For the MySQL database, the  `$name ` string is escaped in order to prevent SQL injection attacks. See link:http://en.wikipedia.org/wiki/SQL_injection[+Wikipedia on SQL injections+] and the link:http://us3.php.net/mysql_real_escape_string[+mysql_real_escape_string documentation+]. Although in the context of this tutorial you are not at risk of harmful SQL injections, it is best practice to escape strings in MySQL queries that would be at risk of such an attack. The Oracl [...]
 
 
+[[getWishesByID]]
 === Function get_wishes_by_wisher_id
 
 The function requires the id of a wisher as the input parameter and returns the wishes registered for the wisher.
@@ -274,33 +286,38 @@ Enter the following code block:
 
 *For the MySQL database:*
 
-
-[source,java]
+[source,php]
 ----
 
-public function get_wishes_by_wisher_id($wisherID) {return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);}
+public function get_wishes_by_wisher_id($wisherID) {
+  return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+}
+
 ----
 
 *For the Oracle database:*
 
-
-[source,java]
+[source,php]
 ----
 
 public function get_wishes_by_wisher_id($wisherID) {
-    $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ":id_bv", $wisherID);
-    oci_execute($stid);
-    return $stid;
+  
+  $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
+  $stid = oci_parse($this->con, $query);
+  
+  oci_bind_by_name($stid, ":id_bv", $wisherID);
+  oci_execute($stid);
+
+  return $stid;
 }
-----
 
-The code block executes the query  ``"SELECT id, description, due_date FROM wishes WHERE wisherID=" . $wisherID``  and returns a resultset which is an array of records that meet the query. (The Oracle database uses a bind variable for database performance and security reasons.) The selection is performed by the wisherID, which is the foreign key for the  ``wishes `` table.
+----
 
-NOTE: You do not need the  ``id``  value until Lesson 7.
+The code block executes the query  `"SELECT id, description, due_date FROM wishes WHERE wisherID=" . $wisherID`  and returns a resultset which is an array of records that meet the query. (The Oracle database uses a bind variable for database performance and security reasons.) The selection is performed by the wisherID, which is the foreign key for the  `wishes ` table.
 
+NOTE: You do not need the  `id`  value until Lesson 7.
 
+[[createWisher]]
 === Function create_wisher
 
 The function creates a new record in the wishers table. The function requires the name and password of a new wisher as the input parameters and does not return any data.
@@ -309,56 +326,73 @@ Enter the following code block:
 
 *For the MySQL database:*
 
-
-[source,java]
+[source,php]
 ----
 
-public function create_wisher ($name, $password){
-    $name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$this->query("INSERT INTO wishers (name, password) VALUES ('" . $name . "', '" . $password . "')");
+public function create_wisher ($name, $password) {
+
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+
+  return $this->query("INSERT INTO wishers (name, password) VALUES ('" . $name . "', '" . $password . "')");
 }
+
 ----
 
 *For the Oracle database:*
 
-
-[source,java]
+[source,php]
 ----
 
 public function create_wisher($name, $password) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':user_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($this->con, $query);
+
+  oci_bind_by_name($stid, ':user_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
+  return $stid;
 }
+
 ----
-The code block executes the query  ``"INSERT wishers (Name, Password) VALUES ([variables representing name and password of new wisher])`` . The query adds a new record to the "wishers" table with the fields "name" and "password" filled in with the values of  ``$name``  and  ``$password``  respectively.
 
+The code block executes the query  `"INSERT wishers (Name, Password) VALUES ([variables representing name and password of new wisher])` . The query adds a new record to the "wishers" table with the fields "name" and "password" filled in with the values of  `$name`  and  `$password`  respectively.
 
+
+[[refactoring]]
 == Refactoring Your Application Code
 
 Now that you have a separate class for working with the database, you can replace duplicated blocks with calls to the relevant functions from this class. This will help avoid misspelling and inconsistency in the future. Code optimization that does not affect the functionality is called refactoring.
 
 
+[[refactoringWishlistFile]]
 === Refactoring the wishlist.php File
 
 Start with the wishlist.php file because it is short and the improvements will be more illustrative.
 
-1. At the top of the <?php ?> block, enter the following line to enable the use of the  ``db.php``  file:
+1. At the top of the <?php ?> block, enter the following line to enable the use of the  `db.php`  file:
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
+
 ----
-2. Replace the code that connects to the database and gets the ID of the wisher with a call to the  ``get_wisher_id_by_name``  function.
+2. Replace the code that connects to the database and gets the ID of the wisher with a call to the  `get_wisher_id_by_name`  function.
 
 For the *MySQL database*, the code you replace is:
 
-[.line-through]#$con = mysqli_connect("localhost", "phpuser", "phpuserpw");
+[source,php]
+----
+
+// to remove
+
+ $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
@@ -367,211 +401,271 @@ mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_GET['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='" . $user . "'");
 if (mysqli_num_rows($wisher) < 1) {
-    exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
+  exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
 }
-$row = mysqli_fetch_row($wisher);$wisherID = $row[0];
-mysqli_free_result($wisher);#
+$row = mysqli_fetch_row($wisher);
+$wisherID = $row[0];
+mysqli_free_result($wisher);
+
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
+----
 
 For the *Oracle database*, the code you replace is:
 
-[.line-through]#$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE");
 if (!$con) {
-   $m = oci_error();
-   echo $m['message'], "\n";
-   exit;
-}
-$query = "SELECT id FROM wishers WHERE name = :user_bv";
+  $m = oci_error();
+  echo $m['message'], "\n";
+  exit;
+}        
+$query = "SELECT ID FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
-$user = $_GET["user"];
+$user = $_GET['user'];
 
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
-//Because user is a unique value I only expect one row$row = oci_fetch_array($stid, OCI_ASSOC);
+//Because user is a unique value I only expect one row
+$row = oci_fetch_array($stid, OCI_ASSOC);
 if (!$row) {
-    echo("The person " . $user . " is not found. Please check the spelling and try again" );exit;}
-$wisherID = $row["ID"]; #
+  echo("The person " . $user . " is not found. Please check the spelling and try again" );
+  exit;
+}
+$wisherID = $row['ID']; 
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
 ----
 
-The new code first calls the  ``getInstance``  function in WishDB. The  ``getInstance``  function returns an instance of WishDB, and the code calls the  ``get_wisher_id_by_name``  function within that instance. If the requested wisher is not found in the database, the code kills the process and displays an error message.
+The new code first calls the  `getInstance`  function in WishDB. The  `getInstance`  function returns an instance of WishDB, and the code calls the  `get_wisher_id_by_name`  function within that instance. If the requested wisher is not found in the database, the code kills the process and displays an error message.
 
 No code is necessary here for opening a connection to the database. The connection is opened by the constructor of the WishDB class. If the name and/or password changes, you need to update only the relevant variables of the WishDB class.
 
-3. Replace the code that gets wishes for a wisher identified by ID with code that calls the  ``get_wishes_by_wisher_id``  function.
+3. Replace the code that gets wishes for a wisher identified by ID with code that calls the  `get_wishes_by_wisher_id`  function.
 
 For the *MySQL database*, the code you replace is:
 
-[.line-through]#$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=". $wisherID);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+
+// to replace      
+ 
+$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
 
 For the *Oracle database*, the code you replace is:
 
-[.line-through]#$query = "select * from wishes where wisher_id = :id_bv";$stid = oci_parse($con, $query);oci_bind_by_name($stid, ":id_bv", $wisherID);oci_execute($stid);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$query = "SELECT description, due_date FROM wishes WHERE wisher_id = :id_bv";
+$stid = oci_parse($con, $query);
+oci_bind_by_name($stid, ":id_bv", $wisherID);
+oci_execute($stid);
+
+// to replace
+
+$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
+
 4. Remove the line that closes the database connection.
 
-[source,java]
+[source,php]
 ----
 
- [.line-through]#mysqli_close($con);#
-                    or
- [.line-through]#oci_close($con);#                
-----
-The code is not necessary because the connection to the database is automatically closed when the WishDB object is destroyed. However, keep the code that frees the resource. You need to free all resources that use a connection to ensure that a connection is properly closed, even if you call a  ``close``  function or destroy the instance with the database connection.
+// For MYSQL database
+mysqli_close($con);
 
+// For Oracle database
+oci_close($con);
 
-===  
+----
 
+The code is not necessary because the connection to the database is automatically closed when the WishDB object is destroyed. However, keep the code that frees the resource. You need to free all resources that use a connection to ensure that a connection is properly closed, even if you call a  `close`  function or destroy the instance with the database connection.
 
+
+[[refactoringCreateNewWisher]]
 === Refactoring the createNewWisher.php File
 
 Refactoring will not affect the HTML input form or the code for displaying the related error messages.
 
-1. At the top of the <?php?> block, enter the following code to enable the use of the  ``db.php``  file:
+1. At the top of the <?php?> block, enter the following code to enable the use of the  `db.php`  file:
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
+
 ----
-2. Delete the database connection credentials ( ``$dbHost,``  etc). These are now in  ``db.php`` .
-3. Replace the code that connects to the database and gets the ID of the wisher with a call to the  ``get_wisher_id_by_name``  function.
+
+2. Delete the database connection credentials ( `$dbHost,`  etc). These are now in  `db.php` .
+3. Replace the code that connects to the database and gets the ID of the wisher with a call to the  `get_wisher_id_by_name`  function.
 
 For the *MySQL database*, the code you replace is:
 
-[.line-through]#
+[source,php]
+----
+
+// to remove
+
 $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
 
-
 /** Check whether a user whose name matches the "user" field already exists */
 mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_POST['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='".$user."'");
 $wisherIDnum=mysqli_num_rows($wisher);
 if ($wisherIDnum) {
-   $userNameIsUnique = false;
-}#
+  $userNameIsUnique = false;
+}
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
 
 For the *Oracle database*, the code you replace is:
 
-[.line-through]#
-$con = oci_connect("phpuser", "phpuserpw", "localhost");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
 if (!$con) {
-    $m = oci_error();
-    echo $m['message'], "\n";
-    exit;
+  $m = oci_error();
+  exit('Connect Error ' . $m['message']);
 }
-$query = "select ID from wishers where name = :user_bv";
+$query = "SELECT id FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
 $user = $_POST['user'];
-$wisherID = null;
+
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
 //Each user name should be unique. Check if the submitted user already exists.
-$row = oci_fetch_array($stid, OCI_ASSOC);if ($row) {$wisherID = $row["ID"]; }if ($wisherID != null) {$userNameIsUnique = false;}#
-
-[source,java]
-----
+$row = oci_fetch_array($stid, OCI_ASSOC);
+if ($row) {
+  $userNameIsUnique = false;
+}
 
+// to replace
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
-The  ``WishDB``  object exists as long as the current page is being processed. It is destroyed after the processing is completed or interrupted. The code for opening a connection to the database is not necessary because this is done by the WishDB function. The code for closing the connection is not necessary because the connection is closed as soon as the  ``WishDB``  object is destroyed.
-4. Replace the code that inserts new wishers into the database with code that calls the  ``create_wisher``  function.
 
-For the *MySQL database*, the code you replace is:
+The  `WishDB`  object exists as long as the current page is being processed. It is destroyed after the processing is completed or interrupted. The code for opening a connection to the database is not necessary because this is done by the WishDB function. The code for closing the connection is not necessary because the connection is closed as soon as the  `WishDB`  object is destroyed.
+4. Replace the code that inserts new wishers into the database with code that calls the  `create_wisher`  function.
 
-[.line-through]#if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $password = mysqli_real_escape_string($con, $_POST["password"]);mysqli_select_db($con, "wishlist");mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");mysqli_free_result($wisher);mysqli_close($con);header('Location: editWishList.php');exit;}
-                    #
+For the *MySQL database*, the code you replace is:
 
-[source,java]
+[source,php]
 ----
 
-                *if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
+// to remove
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+  $password = mysqli_real_escape_string($con, $_POST['password']);
+  mysqli_select_db($con, "wishlist");
+  mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");
+  mysqli_free_result($wisher);
+  mysqli_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
 ----
 
 For the *Oracle database*, the code you replace is:
 
-[.line-through]#
-if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($con, $query);
-    $pwd = $_POST['password'];
-    oci_bind_by_name($stid, ':user_bv', $user);
-    oci_bind_by_name($stid, ':pwd_bv', $pwd);
-    oci_execute($stid);
-    oci_close($con);
-    header('Location: editWishList.php');
-    exit;
-}#
-
-[source,java]
+[source,php]
 ----
 
+// to remove
 
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
-*if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
-----
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($con, $query);
+  $pwd = $_POST['password'];
+  oci_bind_by_name($stid, ':user_bv', $user);
+  oci_bind_by_name($stid, ':pwd_bv', $pwd);
+  oci_execute($stid);
+  oci_free_statement($stid);
+  oci_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
+----
 
+[[lessonResultSourceCode]]
 == Application Source Code after the Current Lesson Is Completed
 
 MySQL users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Flesson4.zip[+here+] to download the source code that reflects the project state after the lesson is completed.
 
-Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson4.zip[+ here+] to download the source code that reflects the project state after the lesson is completed.
+Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson4.zip[+here+] to download the source code that reflects the project state after the lesson is completed.
 
 
 == Next Steps
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_ja.asciidoc
index 99dfab6..d28f810 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_ja.asciidoc
@@ -41,41 +41,20 @@
 :description: レッスン4: クラスとオブジェクトを持つコードの最適化 - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, レッスン4: クラスとオブジェクトを持つコードの最適化
 
+このレッスンでは、コードを最適化し、将来のコードの保守を容易にします。これは、 `createNewWisher.php` ファイルおよび `wishlist.php` ファイルに影響します。また、 `db.php` というファイルが新しく作成されます。
 
-
-1. link:wish-list-tutorial-main-page.html[+PHPを使用するデータベース駆動型アプリケーションの作成 - メイン・ページ+]
-2. 
-データベースの作成
-
-1. link:wish-list-lesson1.html[+MySQLデータベースの作成+]
-2. link:wish-list-oracle-lesson1.html[+Oracleデータベース表の作成+]
-3. link:wish-list-lesson2.html[+アプリケーションの設計。データベースからの読取り+]
-4. link:wish-list-lesson3.html[+新規アプリケーション・ユーザーの作成+]
-5. 
-*=> コードの最適化*
-
-6. link:wish-list-lesson5.html[+セキュリティの追加。アプリケーション・ユーザー・ログオンの実装+]
-7. link:wish-list-lesson6.html[+データベースへの新しいウィッシュの追加+]
-8. link:wish-list-lesson7.html[+データベース内のエントリの更新および削除+]
-9. link:wish-list-lesson8.html[+CSSテクノロジを使用したアプリケーションの外観の改良+]
-10. link:wish-list-lesson9.html[+リモートWebサーバーへのアプリケーションのデプロイ+]
-
-image::images/netbeans-stamp-80-74-73.png[title="このページの内容は、NetBeans IDE 7.2、7.3、7.4および8.0に適用されます"]
-
-このレッスンでは、コードを最適化し、将来のコードの保守を容易にします。これは、 ``createNewWisher.php`` ファイルおよび ``wishlist.php`` ファイルに影響します。また、 ``db.php`` というファイルが新しく作成されます。
-
-アプリケーションのコードには、データベースへの問合せを持つ、類似するブロックがいくつか含まれています。コードを将来読みやすく、保守しやすくするために、これらのブロックを抽出して ``WishDB`` と呼ばれる個別クラスの関数として実装し、 ``WishDB`` を ``db.php`` 内に置くことができます。後で ``db.php`` ファイルを任意のPHPファイルに含め、コードの複製を行わずに<<includedFunctions,WishDBから任意の関数>>を使用できます。このような方法によって、問合せまたは関数への変更を1箇所で行うことができ、アプリケーション・コード全体を解析する必要はありません。
+アプリケーションのコードには、データベースへの問合せを持つ、類似するブロックがいくつか含まれています。コードを将来読みやすく、保守しやすくするために、これらのブロックを抽出して `WishDB` と呼ばれる個別クラスの関数として実装し、 `WishDB` を `db.php` 内に置くことができます。後で `db.php` ファイルを任意のPHPファイルに含め、コードの複製を行わずに<<includedFunctions,WishDBから任意の関数>>を使用できます。このような方法によって、問合せまたは関数への変更を1箇所で行うことができ、アプリケーション・コード全体を解析する必要はありません。
 
 WishDBから関数を使用する場合、WishDBの変数の値は変更しません。かわりに、WishDBのオブジェクト作成用の設計図としてWishDBクラスを使用して、そのオブジェクトの変数の値を変更します。そのオブジェクトの操作が終了すると、そのオブジェクトは破棄されます。WishDBクラス自体の値は変わらないので、クラスを何度も再利用できます。場合によっては、クラスのインスタンスが複数同時に存在したり、同時に存在するインスタンスが1つのみ、つまり「単一」クラスにする場合もあります。このチュートリアルのWishDBは単一クラスです。
 
 クラスのオブジェクトの作成を示す用語はクラスの「インスタンス化」で、オブジェクトを別の言葉で言うと、クラスの「インスタンス」です。クラスとオブジェクトを使用するプログラミングを示す一般的な用語は、「オブジェクト指向プログラミング」、またはOOPです。PHP 5では、高度なOOPモデルを使用します。詳細は、link:http://us3.php.net/zend-engine-2.php[+php.net+]を参照してください。
 
-このチュートリアルでは、データベース・コール機能を個々のPHPファイルからWishDBクラスに移動します。また、MySQLのユーザーは、手続き型の ``mysqli`` コールをオブジェクト指向のコールに置き換えます。これは、アプリケーションの新しいオブジェクト指向設計に沿っています。
+このチュートリアルでは、データベース・コール機能を個々のPHPファイルからWishDBクラスに移動します。また、MySQLのユーザーは、手続き型の `mysqli` コールをオブジェクト指向のコールに置き換えます。これは、アプリケーションの新しいオブジェクト指向設計に沿っています。
 
 現在のドキュメントは、PHP向けのNetBeans IDEでのCRUDアプリケーションの作成というPHPチュートリアルの一部です。
 
 
-
+[[previousLessonSourceCode]]
 == 前のレッスンからのアプリケーション・ソース・コード
 
 MySQLユーザー: 前のレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/files/documents/4/1929/lesson3.zip[+ここ+]をクリックします。
@@ -83,6 +62,7 @@ MySQLユーザー: 前のレッスンが完了した後のプロジェクトの
 Oracleデータベース・ユーザー: 前のレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson3.zip[+ここ+]をクリックします。
 
 
+[[createDbPhpFile]]
 == db.phpファイルの作成
 
 「ソース・ファイル」フォルダに新しいサブフォルダを作成します。フォルダに「Includes」という名前を付けます。db.phpという名前の新しいファイルを作成し、このファイルを「Includes」に配置します。後で、他のPHPファイルでインクルードされる別のファイルをこのフォルダに追加できます。
@@ -95,48 +75,54 @@ Oracleデータベース・ユーザー: 前のレッスンが完了した後の
 4. 「ファイル名」フィールドに「db」と入力します。次に、「終了」をクリックします。
 
 
+[[wishDBClass]]
 == WishDBクラスの作成
 
-WishDBクラスを作成するには、クラスの変数を初期化し、クラスのコンストラクタを実装する必要があります。MySQLユーザーは、WishDBクラスが ``mysqli`` を_拡張_することに注意してください。これは、WishDBがPHP mysqliクラスの関数およびその他の特性を_継承_することを意味します。 ``mysqli`` 関数をクラスに追加するときに、この重要性が理解できます。
+WishDBクラスを作成するには、クラスの変数を初期化し、クラスのコンストラクタを実装する必要があります。MySQLユーザーは、WishDBクラスが `mysqli` を_拡張_することに注意してください。これは、WishDBがPHP mysqliクラスの関数およびその他の特性を_継承_することを意味します。 `mysqli` 関数をクラスに追加するときに、この重要性が理解できます。
 
-db.phpファイルを開き、WishDBクラスを作成します。クラス内では、データベースの所有者(ユーザー)の名前とパスワード、データベースの名前、およびデータベース・ホストを格納するためのデータベース構成変数を宣言します。これらの変数の宣言はすべて「private」で、これは、WishDBクラスの外部から宣言の初期値にアクセスできないことを意味します(link:http://us3.php.net/manual/en/language.oop5.visibility.php[+php.net+]を参照)。また、WishDBのインスタンスを格納する、private_ static_  ``$instance`` 変数も宣言します。「static」キーワードは、クラスのインスタンスが存在しない場合でも、クラス内の関数は変数にアクセスできることを意味します。
+db.phpファイルを開き、WishDBクラスを作成します。クラス内では、データベースの所有者(ユーザー)の名前とパスワード、データベースの名前、およびデータベース・ホストを格納するためのデータベース構成変数を宣言します。これらの変数の宣言はすべて「private」で、これは、WishDBクラスの外部から宣言の初期値にアクセスできないことを意味します(link:http://us3.php.net/manual/en/language.oop5.visibility.php[+php.net+]を参照)。また、WishDBのインスタンスを格納する、private_ static_  `$instance` 変数も宣言します。「static」キーワードは、クラスのインスタンスが存在しない場合でも、クラス内の関数は変数にアクセスできることを意味します。
 
 *MySQLデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
 class WishDB extends mysqli {
 
-
     // single instance of self shared among all instances
     private static $instance = null;
 
-
     // db connection config vars
     private $user = "phpuser";
     private $pass = "phpuserpw";
     private $dbName = "wishlist";
     private $dbHost = "localhost";
+
 }
+
 ----
 
 *Oracleデータベースの場合:*
 
-
-[source,java]
+[source,php]
 ----
 
-class WishDB {// single instance of self shared among all instances
-private static $instance = null;// db connection config vars
-private $user = "phpuser";
-private $pass = "phpuserpw";
-private $dbName = "wishlist";
-private $dbHost = "localhost/XE";
-private $con = null;}        
-----
+class WishDB {
+
+    // single instance of self shared among all instances
+    private static $instance = null;
+
+    // db connection config vars
+    private $user = "phpuser";
+    private $pass = "phpuserpw";
+    private $dbName = "wishlist";
+    private $dbHost = "localhost/XE";
+    private $con = null;
+
+}
 
+----
 
 [[instantiate-wishdb]]
 == WishDBクラスのインスタンス化
@@ -146,31 +132,37 @@ WishDBクラスの関数を使用するその他のPHPファイルの場合、
 WishDBクラスの内部に、次のコードを入力するか、または貼り付けます。
 
 
-[source,java]
+[source,php]
 ----
 
- //This method must be static, and must return an instance of the object if the object
- //does not already exist.
- public static function getInstance() {
-   if (!self::$instance instanceof self) {
-     self::$instance = new self;
-   }
-   return self::$instance;
- }
+// This method must be static, and must return an instance of the object if the object
+// does not already exist.
+
+public static function getInstance() {
+
+  if (!self::$instance instanceof self) {
+    self::$instance = new self;
+  }
+
+  return self::$instance;
+}
+
+// The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
+// thus eliminating the possibility of duplicate objects.
+ 
+public function __clone() {
+  trigger_error('Clone is not allowed.', E_USER_ERROR);
+}
+
+public function __wakeup() {
+  trigger_error('Deserializing is not allowed.', E_USER_ERROR);
+}
 
- // The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
- // thus eliminating the possibility of duplicate objects.
- public function __clone() {
-   trigger_error('Clone is not allowed.', E_USER_ERROR);
- }
- public function __wakeup() {
-   trigger_error('Deserializing is not allowed.', E_USER_ERROR);
- }
 ----
 
- ``getInstance`` 関数は、「public」および「static」です。「public」とは、クラスの外部から自由にアクセスできることを意味します。「static」とは、クラスがインスタンス化されていない場合でも、その関数が使用可能であることを意味します。 ``getInstance`` 関数はクラスをインスタンス化するためにコールされるため、staticである必要があります。この関数は静的な ``$instance`` 変数にアクセスし、その値をクラスのインスタンスとして設定します。
+ `getInstance` 関数は、「public」および「static」です。「public」とは、クラスの外部から自由にアクセスできることを意味します。「static」とは、クラスがインスタンス化されていない場合でも、その関数が使用可能であることを意味します。 `getInstance` 関数はクラスをインスタンス化するためにコールされるため、staticである必要があります。この関数は静的な `$instance` 変数にアクセスし、その値をクラスのインスタンスとして設定します。
 
-ダブルコロン(::)はスコープ解決演算子と呼ばれ、静的関数にアクセスするために ``self`` キーワードが使用されます。 ``self`` は、クラス定義の内部からクラス自身を参照するのに使用されます。ダブルコロンがクラス定義の外部で使用された場合、 ``self`` のかわりにクラスの名前が使用されます。link:http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php[+スコープ解決演算子に関するphp.net+]を参照してください。
+ダブルコロン(::)はスコープ解決演算子と呼ばれ、静的関数にアクセスするために `self` キーワードが使用されます。 `self` は、クラス定義の内部からクラス自身を参照するのに使用されます。ダブルコロンがクラス定義の外部で使用された場合、 `self` のかわりにクラスの名前が使用されます。link:http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php[+スコープ解決演算子に関するphp.net+]を参照してください。
 
 
 [[wishdb-constructor]]
@@ -182,33 +174,45 @@ WishDBに次のコードを追加します。
 
 *MySQLデータベースの場合:*
 
-
-[source,java]
+[source,php]
 ----
 
-// private constructorprivate function __construct() {parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);if (mysqli_connect_error()) {exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());}parent::set_charset('utf-8');}
+// private constructor
+private function __construct() {
+
+  parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);
+  
+  if (mysqli_connect_error()) {
+    exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
+  }
+
+  parent::set_charset('utf-8');
+}
+
 ----
 
 *Oracleデータベースの場合:*
 
-
-[source,java]
+[source,php]
 ----
 
 // private constructor
 private function __construct() {
+
     $this->con = oci_connect($this->user, $this->pass, $this->dbHost);
+
     if (!$this->con) {
         $m = oci_error();
         echo $m['message'], "\n";
         exit;
     }
 }
-----
 
-変数 ``$con`` 、 ``$dbHost`` 、 ``$user`` 、または ``$pass`` のかわりに、疑似変数 ``$this`` を使用しています。メソッドがオブジェクトのコンテキスト内からコールされた場合、疑似変数 ``$this`` が使用されます。これはオブジェクト内の変数の値を参照します。
+----
 
+変数 `$con` 、 `$dbHost` 、 `$user` 、または `$pass` のかわりに、疑似変数 `$this` を使用しています。メソッドがオブジェクトのコンテキスト内からコールされた場合、疑似変数 `$this` が使用されます。これはオブジェクト内の変数の値を参照します。
 
+[[includedFunctions]]
 == WishDBクラスの関数
 
 このレッスンでは、WishDBクラスの次の関数を実装します。
@@ -218,6 +222,7 @@ private function __construct() {
 * wishers表に新しいウィッシャのレコードを追加する<<createWisher,create_wisher>>
 
 
+[[getIDByName]]
 === 関数get_wisher_id_by_name
 
 この関数は、入力パラメータとしてウィッシャの名前が必要で、ウィッシャのIDを返します。
@@ -227,34 +232,56 @@ WishDBクラスのWishDB関数の後に、次の関数を入力するか、ま
 *MySQLデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function get_wisher_id_by_name($name) {$name = $this->real_escape_string($name);$wisher = $this->query("SELECT id FROM wishers WHERE name = '". $name . "'");
-    if ($wisher->num_rows > 0){$row = $wisher->fetch_row();return $row[0];} elsereturn null;
+public function get_wisher_id_by_name($name) {
+  
+  $name = $this->real_escape_string($name);
+  $wisher = $this->query("SELECT id FROM wishers WHERE name = '" . $name . "'");
+
+  if ($wisher->num_rows > 0){
+    $row = $wisher->fetch_row();
+    return $row[0];
+  } else {
+    return null;
+  }
 }
+
 ----
 
 *Oracleデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wisher_id_by_name($name) {
+    
     $query = "SELECT id FROM wishers WHERE name = :user_bv";
     $stid = oci_parse($this->con, $query);
+    
     oci_bind_by_name($stid, ':user_bv', $name);
     oci_execute($stid);
-//Because user is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);if ($row) return $row["ID"];elsereturn null;
+    
+    //Because user is a unique value I only expect one row
+    $row = oci_fetch_array($stid, OCI_ASSOC);
+
+    if ($row) {
+      return $row["ID"];
+    } else {
+      return null;
+    }
 }
+
 ----
-このコード・ブロックは、問合せ ``SELECT ID FROM wishers WHERE name=[ウィッシャの名前の変数]`` を実行します。問合せの結果は、問合せに一致するレコードのIDの配列です。配列が空でない場合は自動的に要素を1つ含むことを意味し、これは、表の作成時にフィールド名がUNIQUEとして指定されたためです。この場合、関数は ``$result`` 配列の最初の要素(番号が0の要素)を返します。配列が空の場合、関数はnullを返します。
 
-*セキュリティ上の注意:* MySQLデータベースの場合、 ``$name`` 文字列は、SQLインジェクション攻撃を避けるためにエスケープされます。link:http://en.wikipedia.org/wiki/SQL_injection[+SQLインジェクションに関するWikipedia+]およびlink:http://us3.php.net/mysql_real_escape_string[+mysql_real_escape_stringのドキュメント+]を参照してください。このチュートリアルのコンテキストでは、有害なSQLインジェクションのリスクはありませんが、そのような攻撃のリスクになるようなMySQL問合せの文字列はエスケープすることをお薦めします。Oracleデータベースでは、バインド変数を使用してこの問題を回避します。
+このコード・ブロックは、問合せ `SELECT ID FROM wishers WHERE name=[ウィッシャの名前の変数]` を実行します。問合せの結果は、問合せに一致するレコードのIDの配列です。配列が空でない場合は自動的に要素を1つ含むことを意味し、これは、表の作成時にフィールド名がUNIQUEとして指定されたためです。この場合、関数は `$result` 配列の最初の要素(番号が0の要素)を返します。配列が空の場合、関数はnullを返します。
+
+*セキュリティ上の注意:* MySQLデータベースの場合、 `$name` 文字列は、SQLインジェクション攻撃を避けるためにエスケープされます。link:http://en.wikipedia.org/wiki/SQL_injection[+SQLインジェクションに関するWikipedia+]およびlink:http://us3.php.net/mysql_real_escape_string[+mysql_real_escape_stringのドキュメント+]を参照してください。このチュートリアルのコンテキストでは、有害なSQLインジェクションのリスクはありませんが、そのような攻撃のリスクになるようなMySQL問合せの文字列はエスケープすることをお薦めします。Oracleデータベースでは、バインド変数を使用してこの問題を回避します。
 
 
+[[getWishesByID]]
 === 関数get_wishes_by_wisher_id
 
 この関数は、入力パラメータとしてウィッシャのIDを必要とし、そのウィッシャに対して登録されているウィッシュを返します。
@@ -264,32 +291,40 @@ public function get_wisher_id_by_name($name) {
 *MySQLデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function get_wishes_by_wisher_id($wisherID) {return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);}
+public function get_wishes_by_wisher_id($wisherID) {
+  return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+}
+
 ----
 
 *Oracleデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wishes_by_wisher_id($wisherID) {
-    $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ":id_bv", $wisherID);
-    oci_execute($stid);
-    return $stid;
+  
+  $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
+  $stid = oci_parse($this->con, $query);
+  
+  oci_bind_by_name($stid, ":id_bv", $wisherID);
+  oci_execute($stid);
+
+  return $stid;
 }
+
 ----
 
-コード・ブロックは、問合せ ``"SELECT id, description, due_date FROM wishes WHERE wisherID=" . $wisherID`` を実行し、問合せに一致するレコードの配列である結果セットを返します。(Oracleデータベースでは、データベースのパフォーマンスとセキュリティ上の理由でバインド変数を使用します。)この選択は、 ``wishes`` 表の外部キーであるwisherIDによって実行されます。
+コード・ブロックは、問合せ `"SELECT id, description, due_date FROM wishes WHERE wisherID=" . $wisherID` を実行し、問合せに一致するレコードの配列である結果セットを返します。(Oracleデータベースでは、データベースのパフォーマンスとセキュリティ上の理由でバインド変数を使用します。)この選択は、 `wishes` 表の外部キーであるwisherIDによって実行されます。
 
-*注意:*  ``id`` 値はレッスン7までは不要です。
+*注意:*  `id` 値はレッスン7までは不要です。
 
 
+[[createWisher]]
 === 関数create_wisher
 
 この関数は、wishers表に新しいレコードを作成します。この関数は、入力パラメータとして新しいウィッシャの名前とパスワードを必要とし、何もデータを返しません。
@@ -310,44 +345,58 @@ public function create_wisher ($name, $password){
 *Oracleデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function create_wisher($name, $password) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':user_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($this->con, $query);
+
+  oci_bind_by_name($stid, ':user_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
+  return $stid;
 }
+
 ----
-このコード・ブロックは、問合せ ``"INSERT wishers (Name, Password) VALUES ([新しいウィッシャの名前とパスワードを表す変数])`` を実行します。問合せによって、 ``$name`` と ``$password`` の値がそれぞれ入力された「name」フィールドと「password」フィールドを持つ「wishers」表に、新しいレコードが追加されます。
 
+このコード・ブロックは、問合せ `"INSERT wishers (Name, Password) VALUES ([新しいウィッシャの名前とパスワードを表す変数])` を実行します。問合せによって、 `$name` と `$password` の値がそれぞれ入力された「name」フィールドと「password」フィールドを持つ「wishers」表に、新しいレコードが追加されます。
 
+
+[[refactoring]]
 == アプリケーション・コードのリファクタリング
 
 データベースを操作するための別のクラスができたので、重複したブロックを、このクラスからの関連する関数へのコールに置き換えることができます。これは、今後のミススペルと不整合を回避するのに役立ちます。機能に影響しないコードの最適化は、リファクタリングと呼ばれます。
 
 
+[[refactoringWishlistFile]]
 === wishlist.phpファイルのリファクタリング
 
 wishlist.phpファイルは短く、具体的に改良できるため、このファイルから開始します。
 
-1. <?php?>ブロックの先頭に次の行を入力して、 ``db.php`` ファイルを使用できるようにします。
+1. <?php?>ブロックの先頭に次の行を入力して、 `db.php` ファイルを使用できるようにします。
+
+[source,php]
 
-[source,java]
 ----
 
 require_once("Includes/db.php");
 ----
-2. データベースに接続してウィッシャのIDを取得するコードを、 ``get_wisher_id_by_name`` 関数のコールに置き換えます。
+2. データベースに接続してウィッシャのIDを取得するコードを、 `get_wisher_id_by_name` 関数のコールに置き換えます。
 
 *MySQLデータベース*の場合に置き換えるコード:
 
-[.line-through]#$con = mysqli_connect("localhost", "phpuser", "phpuserpw");
+[source,php]
+----
+
+// to remove
+
+ $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
@@ -356,82 +405,113 @@ mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_GET['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='" . $user . "'");
 if (mysqli_num_rows($wisher) < 1) {
-    exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
+  exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
 }
-$row = mysqli_fetch_row($wisher);$wisherID = $row[0];
-mysqli_free_result($wisher);#
+$row = mysqli_fetch_row($wisher);
+$wisherID = $row[0];
+mysqli_free_result($wisher);
+
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
+----
 
 *Oracleデータベース*の場合に置き換えるコード:
 
-[.line-through]#$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE");
 if (!$con) {
-   $m = oci_error();
-   echo $m['message'], "\n";
-   exit;
-}
-$query = "SELECT id FROM wishers WHERE name = :user_bv";
+  $m = oci_error();
+  echo $m['message'], "\n";
+  exit;
+}        
+$query = "SELECT ID FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
-$user = $_GET["user"];
+$user = $_GET['user'];
 
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
-//Because user is a unique value I only expect one row$row = oci_fetch_array($stid, OCI_ASSOC);
+//Because user is a unique value I only expect one row
+$row = oci_fetch_array($stid, OCI_ASSOC);
 if (!$row) {
-    echo("The person " . $user . " is not found. Please check the spelling and try again" );exit;}
-$wisherID = $row["ID"]; #
+  echo("The person " . $user . " is not found. Please check the spelling and try again" );
+  exit;
+}
+$wisherID = $row['ID']; 
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
 ----
 
-新しいコードは、最初にWishDBの ``getInstance`` 関数をコールします。 ``getInstance`` 関数はWishDBのインスタンスを返し、コードはそのインスタンス内の ``get_wisher_id_by_name`` 関数をコールします。リクエストされたウィッシャがデータベース内で見つからない場合、コードはプロセスを強制終了し、エラー・メッセージを表示します。
+新しいコードは、最初にWishDBの `getInstance` 関数をコールします。 `getInstance` 関数はWishDBのインスタンスを返し、コードはそのインスタンス内の `get_wisher_id_by_name` 関数をコールします。リクエストされたウィッシャがデータベース内で見つからない場合、コードはプロセスを強制終了し、エラー・メッセージを表示します。
 
 データベースへの接続を開くコードは、ここでは必要ありません。WishDBクラスのコンストラクタによって接続が開かれます。名前またはパスワード(あるいはその両方)を変更した場合は、WishDBクラスの関連する変数のみ更新する必要があります。
 
-3. IDによって識別されるウィッシャのウィッシュを取得するコードを、 ``get_wishes_by_wisher_id`` 関数をコールするコードに置き換えます。
+3. IDによって識別されるウィッシャのウィッシュを取得するコードを、 `get_wishes_by_wisher_id` 関数をコールするコードに置き換えます。
 
 *MySQLデータベース*の場合に置き換えるコード:
 
-[.line-through]#$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=". $wisherID);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+
+// to replace      
+ 
+$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
 
 *Oracleデータベース*の場合に置き換えるコード:
 
-[.line-through]#$query = "select * from wishes where wisher_id = :id_bv";$stid = oci_parse($con, $query);oci_bind_by_name($stid, ":id_bv", $wisherID);oci_execute($stid);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$query = "SELECT description, due_date FROM wishes WHERE wisher_id = :id_bv";
+$stid = oci_parse($con, $query);
+oci_bind_by_name($stid, ":id_bv", $wisherID);
+oci_execute($stid);
+
+// to replace
+
+$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
+
 4. データベース接続を切断する行を除去します。
 
-[source,java]
+[source,php]
 ----
 
- [.line-through]#mysqli_close($con);#
-                    or
- [.line-through]#oci_close($con);#                
+// For MYSQL database
+mysqli_close($con);
+
+// For Oracle database
+oci_close($con);
+
 ----
-WishDBオブジェクトが破棄されるとデータベースへの接続が自動的に切断されるため、このコードは必要ありません。ただし、リソースを解放するコードは保持します。 ``close`` 関数をコールするか、またはデータベース接続を持つインスタンスを破棄した場合でも、接続を使用するすべてのリソースを解放して、接続が正しく切断されるようにする必要があります。
+
+WishDBオブジェクトが破棄されるとデータベースへの接続が自動的に切断されるため、このコードは必要ありません。ただし、リソースを解放するコードは保持します。 `close` 関数をコールするか、またはデータベース接続を持つインスタンスを破棄した場合でも、接続を使用するすべてのリソースを解放して、接続が正しく切断されるようにする必要があります。
 
 
 ===  
@@ -441,120 +521,148 @@ WishDBオブジェクトが破棄されるとデータベースへの接続が
 
 リファクタリングは、HTML入力フォーム、または関連するエラー・メッセージを表示するためのコードには影響がありません。
 
-1. <?php?>ブロックの先頭に次のコードを入力して、 ``db.php`` ファイルを使用できるようにします。
+1. <?php?>ブロックの先頭に次のコードを入力して、 `db.php` ファイルを使用できるようにします。
 
 [source,java]
 ----
 
 require_once("Includes/db.php");
 ----
-2. データベース接続の資格情報( ``$dbHost,`` など)を削除します。これらは現在 ``db.php`` にあります。
-3. データベースに接続してウィッシャのIDを取得するコードを、 ``get_wisher_id_by_name`` 関数のコールに置き換えます。
+2. データベース接続の資格情報( `$dbHost,` など)を削除します。これらは現在 `db.php` にあります。
+3. データベースに接続してウィッシャのIDを取得するコードを、 `get_wisher_id_by_name` 関数のコールに置き換えます。
 
 *MySQLデータベース*の場合に置き換えるコード:
 
-[.line-through]#
+[source,php]
+----
+
+// to remove
+
 $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
 
-
 /** Check whether a user whose name matches the "user" field already exists */
 mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_POST['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='".$user."'");
 $wisherIDnum=mysqli_num_rows($wisher);
 if ($wisherIDnum) {
-   $userNameIsUnique = false;
-}#
+  $userNameIsUnique = false;
+}
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
 
 *Oracleデータベース*の場合に置き換えるコード:
 
-[.line-through]#
-$con = oci_connect("phpuser", "phpuserpw", "localhost");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
 if (!$con) {
-    $m = oci_error();
-    echo $m['message'], "\n";
-    exit;
+  $m = oci_error();
+  exit('Connect Error ' . $m['message']);
 }
-$query = "select ID from wishers where name = :user_bv";
+$query = "SELECT id FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
 $user = $_POST['user'];
-$wisherID = null;
+
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
 //Each user name should be unique. Check if the submitted user already exists.
-$row = oci_fetch_array($stid, OCI_ASSOC);if ($row) {$wisherID = $row["ID"]; }if ($wisherID != null) {$userNameIsUnique = false;}#
-
-[source,java]
-----
+$row = oci_fetch_array($stid, OCI_ASSOC);
+if ($row) {
+  $userNameIsUnique = false;
+}
 
+// to replace
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
- ``WishDB`` オブジェクトは、現在のページが処理されている間は存在します。これは、処理が完了したり割込みされた後に破棄されます。WishDB関数によってデータベースへの接続が開くため、データベースへの接続を開くコードは必要ありません。 ``WishDB`` オブジェクトが破棄されると同時に接続が切断されるため、接続を切断するためのコードは必要ありません。
-4. 新しいウィッシャをデータベースに挿入するコードを、 ``create_wisher`` 関数をコールするコードに置き換えます。
 
-*MySQLデータベース*の場合に置き換えるコード:
+ `WishDB` オブジェクトは、現在のページが処理されている間は存在します。これは、処理が完了したり割込みされた後に破棄されます。WishDB関数によってデータベースへの接続が開くため、データベースへの接続を開くコードは必要ありません。 `WishDB` オブジェクトが破棄されると同時に接続が切断されるため、接続を切断するためのコードは必要ありません。
+4. 新しいウィッシャをデータベースに挿入するコードを、 `create_wisher` 関数をコールするコードに置き換えます。
 
-[.line-through]#if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $password = mysqli_real_escape_string($con, $_POST["password"]);mysqli_select_db($con, "wishlist");mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");mysqli_free_result($wisher);mysqli_close($con);header('Location: editWishList.php');exit;}
-                    #
+*MySQLデータベース*の場合に置き換えるコード:
 
-[source,java]
+[source,php]
 ----
 
-                *if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
+// to remove
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+  $password = mysqli_real_escape_string($con, $_POST['password']);
+  mysqli_select_db($con, "wishlist");
+  mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");
+  mysqli_free_result($wisher);
+  mysqli_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
 ----
 
 *Oracleデータベース*の場合に置き換えるコード:
 
-[.line-through]#
-if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($con, $query);
-    $pwd = $_POST['password'];
-    oci_bind_by_name($stid, ':user_bv', $user);
-    oci_bind_by_name($stid, ':pwd_bv', $pwd);
-    oci_execute($stid);
-    oci_close($con);
-    header('Location: editWishList.php');
-    exit;
-}#
-
-[source,java]
+[source,php]
 ----
 
+// to remove
 
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
-*if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
-----
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($con, $query);
+  $pwd = $_POST['password'];
+  oci_bind_by_name($stid, ':user_bv', $user);
+  oci_bind_by_name($stid, ':pwd_bv', $pwd);
+  oci_execute($stid);
+  oci_free_statement($stid);
+  oci_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
+----
 
 == 現在のレッスン完了後のアプリケーション・ソース・コード
 
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_pt_BR.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_pt_BR.asciidoc
index 35bb139..8010c5d 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_pt_BR.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_pt_BR.asciidoc
@@ -41,48 +41,26 @@
 :description: Lição 4: Otimizando o Código com Classes e Objetos - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, Lição 4: Otimizando o Código com Classes e Objetos
 
+Nesta lição, você otimizará o código para facilitar sua manutenção no futuro. Isso afeta os arquivos  `createNewWisher.php`  e  `wishlist.php` . Além disso, um novo arquivo chamado  `db.php`  é criado.
 
-
-1. link:wish-list-tutorial-main-page.html[+Criando uma Aplicação Orientada pelo Banco de Dados com o PHP - Página Principal+]
-2. 
-Criando o Banco de Dados
-
-1. link:wish-list-lesson1.html[+Criando um Banco de Dados MySQL+]
-2. link:wish-list-oracle-lesson1.html[+Criando Tabelas do Banco de Dados Oracle+]
-3. link:wish-list-lesson2.html[+Projetando a Aplicação. Lendo o Banco de Dados+]
-4. link:wish-list-lesson3.html[+Criando um Novo Usuário da Aplicação+]
-5. 
-*=> Otimizando o Código*
-
-6. link:wish-list-lesson5.html[+Adicionando Segurança. Implementando o Log-in de Usuário da Aplicação+]
-7. link:wish-list-lesson6.html[+Adicionando um Novo Desejo ao Banco de Dados+]
-8. link:wish-list-lesson7.html[+Atualizando e Deletando Entradas no Banco de Dados+]
-9. link:wish-list-lesson8.html[+Melhorando a Aparência da Aplicação Usando a Tecnologia CSS+]
-10. link:wish-list-lesson9.html[+Implantando a Aplicação em um Servidor Web Remoto+]
-
-image::images/netbeans-stamp-80-74-73.png[title="O conteúdo desta página se aplica ao NetBeans IDE 7.2, 7.3, 7.4 e 8.0"]
-
-Nesta lição, você otimizará o código para facilitar sua manutenção no futuro. Isso afeta os arquivos  ``createNewWisher.php``  e  ``wishlist.php`` . Além disso, um novo arquivo chamado  ``db.php``  é criado.
-
-O código do sua aplicação contém vários blocos de código semelhantes com consultas ao banco de dados. Para facilitar a leitura e a manutenção do código no futuro, você pode extrair esses blocos, implementá-los como funções de uma classe separada chamada  ``WishDB``  e colocar  ``WishDB``  em  ``db.php`` . Depois disso, você pode incluir o arquivo  ``db.php``  em qualquer arquivo PHP e usar qualquer <<includedFunctions,função de WishDB>> sem duplicação de código. Essa abordagem garante qu [...]
+O código do sua aplicação contém vários blocos de código semelhantes com consultas ao banco de dados. Para facilitar a leitura e a manutenção do código no futuro, você pode extrair esses blocos, implementá-los como funções de uma classe separada chamada  `WishDB`  e colocar  `WishDB`  em  `db.php` . Depois disso, você pode incluir o arquivo  `db.php`  em qualquer arquivo PHP e usar qualquer <<includedFunctions,função de WishDB>> sem duplicação de código. Essa abordagem garante que quaisq [...]
 
 Ao usar uma função de WishDB, você não altera o valor de quaisquer variáveis de WishDB. Em vez disso, use a classe WishDB como um plano gráfico para criar um objeto de WishDB, e altere os valores das variáveis nesse objeto. Quando você finaliza o trabalho com esse objeto, ele é destruído. Como os valores da classe WishDB nunca são alterados, você pode reutilizar a classe por um número ilimitado de vezes. Em alguns casos, talvez você queira ter várias instâncias de uma classe ao mesmo tem [...]
 
 Observe que o termo para criar um objeto de uma classe é "instanciar" essa classe, e que outra palavra para um objeto é uma "instância" de uma classe. O termo geral para programar com classes e objetos é "programação orientada por objeto" ou OOP. O PHP 5 usa um modelo OOP sofisticado. Consulte link:http://us3.php.net/zend-engine-2.php[+php.net+] para obter mais informações.
 
-Neste tutorial, a funcionalidade de chamada do banco de dados é movida de arquivos PHP individuais para classes WishDB. Usuários do MySQL também podem substituir a chamada  ``mysqli``  de estilo de procedimento por chamadas orientadas por objetos. Isso é para manter com o novo projeto orientado por objetos da aplicação
+Neste tutorial, a funcionalidade de chamada do banco de dados é movida de arquivos PHP individuais para classes WishDB. Usuários do MySQL também podem substituir a chamada  `mysqli`  de estilo de procedimento por chamadas orientadas por objetos. Isso é para manter com o novo projeto orientado por objetos da aplicação
 
 O documento atual é uma parte do tutorial Criando uma Aplicação CRUD no NetBeans IDE para PHP.
 
-
-
+[[previousLessonSourceCode]]
 == Código-fonte da Aplicação da Lição Anterior
 
 Usuários MySQL: clique link:https://netbeans.org/files/documents/4/1929/lesson3.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição anterior estiver concluída.
 
 Usuários do Banco de Dados Oracle: clique link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson3.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição anterior estiver concluída.
 
-
+[[createDbPhpFile]]
 == Criando o Arquivo db.php
 
 Crie uma nova subpasta na pasta Códigos-fonte. Nomeie a pasta Inclusão. Crie uma nova pasta nomeada db.php e coloque em Inclusão. Depois disso, é possível adicionar mais arquivos para essa pasta que será incluída em outros arquivos PHP.
@@ -94,49 +72,55 @@ Crie uma nova subpasta na pasta Códigos-fonte. Nomeie a pasta Inclusão. Crie u
 3. Clique com o botão direito do mouse no nó Inclusão e selecione Novo > Arquivo PHP no menu de contexto. A caixa de diálogo Novo Arquivo PHP é aberta.
 4. No campo Nome do Arquivo, digite db. Em seguida, clique em Finalizar.
 
-
+[[wishDBClass]]
 == Criando a Classe WishDB
 
-Para criar a classe WishDB, você precisa inicializar as variáveis da classe e implementar um construtor da classe. Usuários MySQL, observem a classe WishDB _extends_  ``mysqli`` . Isso significa que o WishDB _herda_ a função e outras características da classe mysqli PHP. A importância disso é mostrada ao adicionar as funções  ``mysqli``  à classe.
+Para criar a classe WishDB, você precisa inicializar as variáveis da classe e implementar um construtor da classe. Usuários MySQL, observem a classe WishDB _extends_  `mysqli` . Isso significa que o WishDB _herda_ a função e outras características da classe mysqli PHP. A importância disso é mostrada ao adicionar as funções  `mysqli`  à classe.
 
-Abra o arquivo db.php e crie a classe WishDB. Na classe, declare variáveis de configuração de banco de dados para armazenar o nome e a senha do proprietário do banco de dados (usuário), o nome e o host do banco de dados. Todas essas declarações de variável são "privadas", o que significa que os valores iniciais nas declarações não podem ser acessados de fora da classe WishDB (Consulte link:http://us3.php.net/manual/en/language.oop5.visibility.php[+php.net+]). Declare também a variável _  [...]
+Abra o arquivo db.php e crie a classe WishDB. Na classe, declare variáveis de configuração de banco de dados para armazenar o nome e a senha do proprietário do banco de dados (usuário), o nome e o host do banco de dados. Todas essas declarações de variável são "privadas", o que significa que os valores iniciais nas declarações não podem ser acessados de fora da classe WishDB (Consulte link:http://us3.php.net/manual/en/language.oop5.visibility.php[+php.net+]). Declare também a variável _  [...]
 
 *Para o Banco de Dados MySQL:*
 
 
-[source,java]
+[source,php]
 ----
 
 class WishDB extends mysqli {
 
-
     // single instance of self shared among all instances
     private static $instance = null;
 
-
     // db connection config vars
     private $user = "phpuser";
     private $pass = "phpuserpw";
     private $dbName = "wishlist";
     private $dbHost = "localhost";
+
 }
+
 ----
 
-*Para o Banco de Dados Oracle: *
+*Para o Banco de Dados Oracle:*
 
 
-[source,java]
+[source,php]
 ----
 
-class WishDB {// single instance of self shared among all instances
-private static $instance = null;// db connection config vars
-private $user = "phpuser";
-private $pass = "phpuserpw";
-private $dbName = "wishlist";
-private $dbHost = "localhost/XE";
-private $con = null;}        
-----
+class WishDB {
 
+    // single instance of self shared among all instances
+    private static $instance = null;
+
+    // db connection config vars
+    private $user = "phpuser";
+    private $pass = "phpuserpw";
+    private $dbName = "wishlist";
+    private $dbHost = "localhost/XE";
+    private $con = null;
+
+}
+
+----
 
 [[instantiate-wishdb]]
 == Instanciando a classe WishDB
@@ -146,31 +130,37 @@ Para outros arquivos PHP usarem funções na classe WishDB, esses arquivos PHP p
 Dentro da classe WishDB, digite ou cole o seguinte código:
 
 
-[source,java]
+[source,php]
 ----
 
- //This method must be static, and must return an instance of the object if the object
- //does not already exist.
- public static function getInstance() {
-   if (!self::$instance instanceof self) {
-     self::$instance = new self;
-   }
-   return self::$instance;
- }
+// This method must be static, and must return an instance of the object if the object
+// does not already exist.
+
+public static function getInstance() {
+
+  if (!self::$instance instanceof self) {
+    self::$instance = new self;
+  }
+
+  return self::$instance;
+}
+
+// The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
+// thus eliminating the possibility of duplicate objects.
+ 
+public function __clone() {
+  trigger_error('Clone is not allowed.', E_USER_ERROR);
+}
+
+public function __wakeup() {
+  trigger_error('Deserializing is not allowed.', E_USER_ERROR);
+}
 
- // The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
- // thus eliminating the possibility of duplicate objects.
- public function __clone() {
-   trigger_error('Clone is not allowed.', E_USER_ERROR);
- }
- public function __wakeup() {
-   trigger_error('Deserializing is not allowed.', E_USER_ERROR);
- }
 ----
 
-A função  ``getInstance``  é "pública" e "estática." "Pública" significa que ela pode ser acessada publicamente de fora da classe. "Estática" significa que a função está disponível mesmo quando a classe não tiver sido instanciada. Como a função  ``getInstance``  é chamada para instanciar a classe, ela deve ser estática. Observe que essa função acessa a variável ``$instance``  estática e ajusta os valores como a instância da classe.
+A função  `getInstance`  é "pública" e "estática." "Pública" significa que ela pode ser acessada publicamente de fora da classe. "Estática" significa que a função está disponível mesmo quando a classe não tiver sido instanciada. Como a função  `getInstance`  é chamada para instanciar a classe, ela deve ser estática. Observe que essa função acessa a variável `$instance`  estática e ajusta os valores como a instância da classe.
 
-Os dois-pontos duplos (::), chamados de Operador de Resolução de Escopo, e a palavra-chave  ``self``  são usados para acessar funções estáticas.  ``Self``  é usado na definição da classe para se referir à classe em si. Quando os dois-pontos duplos forem usados fora da definição da classe, o nome da classe será usado em vez de  ``self`` . Consulte link:http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php[+php.net no Operador de Resolução de Escopo+].
+Os dois-pontos duplos (::), chamados de Operador de Resolução de Escopo, e a palavra-chave  `self`  são usados para acessar funções estáticas.  `Self`  é usado na definição da classe para se referir à classe em si. Quando os dois-pontos duplos forem usados fora da definição da classe, o nome da classe será usado em vez de  `self` . Consulte link:http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php[+php.net no Operador de Resolução de Escopo+].
 
 
 [[wishdb-constructor]]
@@ -183,32 +173,45 @@ Adicione o código seguinte ao WishDB:
 *Para o banco de dados MySQL:*
 
 
-[source,java]
+[source,php]
 ----
 
-// private constructorprivate function __construct() {parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);if (mysqli_connect_error()) {exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());}parent::set_charset('utf-8');}
+// private constructor
+private function __construct() {
+
+  parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);
+  
+  if (mysqli_connect_error()) {
+    exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
+  }
+
+  parent::set_charset('utf-8');
+}
+
 ----
 
 *Para o banco de dados Oracle:*
 
-
-[source,java]
+[source,php]
 ----
 
 // private constructor
 private function __construct() {
+
     $this->con = oci_connect($this->user, $this->pass, $this->dbHost);
+
     if (!$this->con) {
         $m = oci_error();
         echo $m['message'], "\n";
         exit;
     }
 }
-----
 
-Observe o uso da pseudovariável  ``$this``  em vez das variáveis  ``$con`` ,  ``$dbHost`` ,  ``$user``  ou  ``$pass`` . A pseudovariável  ``$this``  é usada quando um método é chamado de dentro do contexto de um objeto. Ela se refere ao valor de uma variável nesse objeto.
+----
 
+Observe o uso da pseudovariável  `$this`  em vez das variáveis  `$con` ,  `$dbHost` ,  `$user`  ou  `$pass` . A pseudovariável  `$this`  é usada quando um método é chamado de dentro do contexto de um objeto. Ela se refere ao valor de uma variável nesse objeto.
 
+[[includedFunctions]]
 == Funções da Classe WishDB
 
 Nesta lição, você implementará as seguintes funções da classe WishDB:
@@ -218,6 +221,7 @@ Nesta lição, você implementará as seguintes funções da classe WishDB:
 * <<createWisher,create_wisher>> para adicionar um novo registro de wisher aos wishers da tabela
 
 
+[[getIDByName]]
 === Função get_wisher_id_by_name
 
 A função requer o nome de um wisher como parâmetro de entrada e retorna o wisher id. 
@@ -227,34 +231,55 @@ Digite ou cole a seguinte função na classe WishDB, depois da função WishDB:
 *Para o banco de dados MySQL:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function get_wisher_id_by_name($name) {$name = $this->real_escape_string($name);$wisher = $this->query("SELECT id FROM wishers WHERE name = '". $name . "'");
-    if ($wisher->num_rows > 0){$row = $wisher->fetch_row();return $row[0];} elsereturn null;
+public function get_wisher_id_by_name($name) {
+  
+  $name = $this->real_escape_string($name);
+  $wisher = $this->query("SELECT id FROM wishers WHERE name = '" . $name . "'");
+
+  if ($wisher->num_rows > 0){
+    $row = $wisher->fetch_row();
+    return $row[0];
+  } else {
+    return null;
+  }
 }
+
 ----
 
 *Para o banco de dados Oracle:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wisher_id_by_name($name) {
+    
     $query = "SELECT id FROM wishers WHERE name = :user_bv";
     $stid = oci_parse($this->con, $query);
+    
     oci_bind_by_name($stid, ':user_bv', $name);
     oci_execute($stid);
-//Because user is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);if ($row) return $row["ID"];elsereturn null;
+    
+    //Because user is a unique value I only expect one row
+    $row = oci_fetch_array($stid, OCI_ASSOC);
+
+    if ($row) {
+      return $row["ID"];
+    } else {
+      return null;
+    }
 }
+
 ----
-O bloco de código executa a consulta  ``SELECT ID FROM wishers WHERE name = [variável para o nome do wisher]`` . O resultado da consulta é um array de IDs dos registros que satisfazem a consulta. Se o array não estiver vazio, isso significa automaticamente que ele contém um elemento, porque o nome do campo é especificado como UNIQUE durante a criação da tabela. Nesse caso, a função retorna o primeiro elemento do array  ``$result``  (o elemento com zero). Se o array estiver vazio, a funçã [...]
 
-*Observação sobre Segurança:* Para o banco de dados MySQL, a string  ``$name``  tem escape para evitar os ataques de injeção SQL. Consulte link:http://en.wikipedia.org/wiki/SQL_injection[+Wikipedia sobre injeções SQL+] e a documentação mysql_real_escape_string. Embora no contexto deste tutorial você não esteja correndo o risco de injeções SQL prejudiciais, recomendamos escapar as strings nas consultas MySQL que estariam correndo risco de tal ataque. O banco de dados Oracle evita esse pro [...]
+O bloco de código executa a consulta  `SELECT ID FROM wishers WHERE name = [variável para o nome do wisher]` . O resultado da consulta é um array de IDs dos registros que satisfazem a consulta. Se o array não estiver vazio, isso significa automaticamente que ele contém um elemento, porque o nome do campo é especificado como UNIQUE durante a criação da tabela. Nesse caso, a função retorna o primeiro elemento do array  `$result`  (o elemento com zero). Se o array estiver vazio, a função re [...]
 
+*Observação sobre Segurança:* Para o banco de dados MySQL, a string  `$name`  tem escape para evitar os ataques de injeção SQL. Consulte link:http://en.wikipedia.org/wiki/SQL_injection[+Wikipedia sobre injeções SQL+] e a documentação mysql_real_escape_string. Embora no contexto deste tutorial você não esteja correndo o risco de injeções SQL prejudiciais, recomendamos escapar as strings nas consultas MySQL que estariam correndo risco de tal ataque. O banco de dados Oracle evita esse probl [...]
 
+[[getWishesByID]]
 === Função get_wishes_by_wisher_id
 
 A função exige o id de um wisher como o parâmetro de entrada e retorna os desejos registrados para o wisher.
@@ -264,32 +289,39 @@ Indique o seguinte bloco de código:
 *Para o banco de dados MySQL:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function get_wishes_by_wisher_id($wisherID) {return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);}
+public function get_wishes_by_wisher_id($wisherID) {
+  return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+}
+
 ----
 
 *Para o banco de dados Oracle:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wishes_by_wisher_id($wisherID) {
-    $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ":id_bv", $wisherID);
-    oci_execute($stid);
-    return $stid;
+  
+  $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
+  $stid = oci_parse($this->con, $query);
+  
+  oci_bind_by_name($stid, ":id_bv", $wisherID);
+  oci_execute($stid);
+
+  return $stid;
 }
-----
 
-O bloco de código executa a consulta  ``"SELECT id, description, due_date FROM wishes WHERE wisherID=" . $wisherID``  e retorna um conjunto de resultados que é um array de registros que atende à consulta. (O banco de dados Oracle usa variáveis de ligação para o desempenho do banco de dados e motivos de segurança). A seleção é realizada pelo wisherID, que é a chave estrangeira dos  ``desejos``  da tabela.
+----
 
-*Observação:* o valor ``id``  não é necessário até a Lição 7.
+O bloco de código executa a consulta  `"SELECT id, description, due_date FROM wishes WHERE wisherID=" . $wisherID`  e retorna um conjunto de resultados que é um array de registros que atende à consulta. (O banco de dados Oracle usa variáveis de ligação para o desempenho do banco de dados e motivos de segurança). A seleção é realizada pelo wisherID, que é a chave estrangeira dos  `desejos`  da tabela.
 
+*Observação:* o valor `id`  não é necessário até a Lição 7.
 
+[[createWisher]]
 === Função create_wisher
 
 A função cria um novo registro na tabela de wishers. A função requer o nome e a senha de um novo wisher como os parâmetros de entrada e não retorna dados.
@@ -299,55 +331,75 @@ Indique o seguinte bloco de código:
 *Para o banco de dados MySQL:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function create_wisher ($name, $password){
-    $name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$this->query("INSERT INTO wishers (name, password) VALUES ('" . $name . "', '" . $password . "')");
+public function create_wisher ($name, $password) {
+
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+
+  return $this->query("INSERT INTO wishers (name, password) VALUES ('" . $name . "', '" . $password . "')");
 }
+
 ----
 
+
 *Para o banco de dados Oracle:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function create_wisher($name, $password) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':user_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($this->con, $query);
+
+  oci_bind_by_name($stid, ':user_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
+  return $stid;
 }
+
 ----
-O bloco de código executa a consulta  ``"INSERT wishers (Name, Password) VALUES ([variáveis representando o nome e a senha do novo wisher]).``  A consulta adiciona um novo registro à tabela "wishers" com os campos "nome" e "senha" preenchidos com os valores de  ``$name``  e  ``$password``  respectivamente.
+
+O bloco de código executa a consulta  `"INSERT wishers (Name, Password) VALUES ([variáveis representando o nome e a senha do novo wisher]).`  A consulta adiciona um novo registro à tabela "wishers" com os campos "nome" e "senha" preenchidos com os valores de  `$name`  e  `$password`  respectivamente.
 
 
+[[refactoring]]
 == Refatorando o Código da Sua Aplicação
 
 Agora que tem uma classe separada para trabalhar com o banco de dados, você pode substituir blocos duplicados por chamadas para as funções relevantes desta classe. Isso ajudará a evitar erros ortográficos e inconsistência no futuro. A otimização de código que não afeta a funcionalidade é chamada de refatoração.
 
 
+[[refactoringWishlistFile]]
 === Refatorando o Arquivo wishlist.php
 
 Comece com o arquivo wishlist.php porque ele é pequeno e as melhorias serão mais ilustrativas.
 
-1. Na parte superior do bloco <?php ?> , insira a linha seguinte para permitir o uso do arquivo  ``db.php`` :
+1. Na parte superior do bloco <?php ?> , insira a linha seguinte para permitir o uso do arquivo  `db.php` :
 
 [source,java]
 ----
 
 require_once("Includes/db.php");
+
 ----
-2. Substitua o código que estabelece conexão com o banco de dados e que obtém o wisher ID por uma chamada para a função  ``get_wisher_id_by_name`` .
+2. Substitua o código que estabelece conexão com o banco de dados e que obtém o wisher ID por uma chamada para a função  `get_wisher_id_by_name` .
 
 Para o *banco de dados MySQL*, o código a ser substituído é:
 
-[.line-through]#$con = mysqli_connect("localhost", "phpuser", "phpuserpw");
+[source,php]
+----
+
+// to remove
+
+ $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
@@ -356,205 +408,263 @@ mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_GET['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='" . $user . "'");
 if (mysqli_num_rows($wisher) < 1) {
-    exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
+  exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
 }
-$row = mysqli_fetch_row($wisher);$wisherID = $row[0];
-mysqli_free_result($wisher);#
+$row = mysqli_fetch_row($wisher);
+$wisherID = $row[0];
+mysqli_free_result($wisher);
+
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
+----
 
 Para o *banco de dados Oracle*, o código a ser substituído é:
 
-[.line-through]#$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE");
 if (!$con) {
-   $m = oci_error();
-   echo $m['message'], "\n";
-   exit;
-}
-$query = "SELECT id FROM wishers WHERE name = :user_bv";
+  $m = oci_error();
+  echo $m['message'], "\n";
+  exit;
+}        
+$query = "SELECT ID FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
-$user = $_GET["user"];
+$user = $_GET['user'];
 
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
-//Because user is a unique value I only expect one row$row = oci_fetch_array($stid, OCI_ASSOC);
+//Because user is a unique value I only expect one row
+$row = oci_fetch_array($stid, OCI_ASSOC);
 if (!$row) {
-    echo("The person " . $user . " is not found. Please check the spelling and try again" );exit;}
-$wisherID = $row["ID"]; #
+  echo("The person " . $user . " is not found. Please check the spelling and try again" );
+  exit;
+}
+$wisherID = $row['ID']; 
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
 ----
 
-O novo código chama primeiro a função  ``getInstance``  no WishDB. O  ``getInstance``  retorna uma instância de WishDB, e o código chama a função  ``get_wisher_id_by_name``  dentro dessa instância. Se a lista de desejos solicitada não for encontrada no banco de dados, o código terminará o processo, e exibirá uma mensagem de erro.
+O novo código chama primeiro a função  `getInstance`  no WishDB. O  `getInstance`  retorna uma instância de WishDB, e o código chama a função  `get_wisher_id_by_name`  dentro dessa instância. Se a lista de desejos solicitada não for encontrada no banco de dados, o código terminará o processo, e exibirá uma mensagem de erro.
 
 Nenhum código é necessário para abrir uma conexão ao banco de dados. A conexão é aberta pelo construtor da classe WishDB. Se o nome e/ou a senha for alterado, você precisará atualizar somente as variáveis relevantes da classe WishDB.
 
-3. Substitua o código que recebe desejos de um wisher identificado pelo ID com um código que chama a função  ``get_wishes_by_wisher_id`` .
+3. Substitua o código que recebe desejos de um wisher identificado pelo ID com um código que chama a função  `get_wishes_by_wisher_id` .
 
 Para o *banco de dados MySQL*, o código a ser substituído é:
 
-[.line-through]#$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=". $wisherID);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+
+// to replace      
+ 
+$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
 
 Para o *banco de dados Oracle*, o código a ser substituído é:
 
-[.line-through]#$query = "select * from wishes where wisher_id = :id_bv";$stid = oci_parse($con, $query);oci_bind_by_name($stid, ":id_bv", $wisherID);oci_execute($stid);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$query = "SELECT description, due_date FROM wishes WHERE wisher_id = :id_bv";
+$stid = oci_parse($con, $query);
+oci_bind_by_name($stid, ":id_bv", $wisherID);
+oci_execute($stid);
+
+// to replace
+
+$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
+
 4. Remova a linha que fecha a conexão do banco de dados.
 
-[source,java]
+[source,php]
 ----
 
- [.line-through]#mysqli_close($con);#
-                    or
- [.line-through]#oci_close($con);#                
-----
-O código não é necessário porque a conexão ao banco de dados é automaticamente fechada quando o objeto WishDB é destruído. No entanto, mantenha o código que libera o recurso. É necessário liberar todos os recursos que usam uma conexão para garantir que a conexão seja fechada corretamente, mesmo quando a função  ``close``  é chamada ou se a instância for destruída com a conexão do banco de dados.
+// For MYSQL database
+mysqli_close($con);
 
+// For Oracle database
+oci_close($con);
 
-===  
+----
 
+O código não é necessário porque a conexão ao banco de dados é automaticamente fechada quando o objeto WishDB é destruído. No entanto, mantenha o código que libera o recurso. É necessário liberar todos os recursos que usam uma conexão para garantir que a conexão seja fechada corretamente, mesmo quando a função  `close`  é chamada ou se a instância for destruída com a conexão do banco de dados.
 
+[[refactoringCreateNewWisher]]
 === Refatorando o Arquivo createNewWisher.php
 
 A refatoração não afetará o form de entrada HTML ou o código para exibir as mensagens de erro relacionadas.
 
-1. Na parte superior do bloco <?php ?>, insira o código seguinte para permitir o uso do arquivo  ``db.php`` :
+1. Na parte superior do bloco <?php ?>, insira o código seguinte para permitir o uso do arquivo  `db.php` :
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
+
 ----
-2. Delete a credencial da conexão do banco de dados ( ``$dbHost,``  etc). Esses estão agora em  ``db.php.`` .
-3. Substitua o código que estabelece conexão com o banco de dados e que obtém o wisher ID por uma chamada para a função  ``get_wisher_id_by_name`` .
+
+2. Delete a credencial da conexão do banco de dados ( `$dbHost,`  etc). Esses estão agora em  `db.php.` .
+3. Substitua o código que estabelece conexão com o banco de dados e que obtém o wisher ID por uma chamada para a função  `get_wisher_id_by_name` .
 
 Para o *banco de dados MySQL*, o código a ser substituído é:
 
-[.line-through]#
+[source,php]
+----
+
+// to remove
+
 $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
 
-
 /** Check whether a user whose name matches the "user" field already exists */
 mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_POST['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='".$user."'");
 $wisherIDnum=mysqli_num_rows($wisher);
 if ($wisherIDnum) {
-   $userNameIsUnique = false;
-}#
+  $userNameIsUnique = false;
+}
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
 
 Para o *banco de dados Oracle*, o código a ser substituído é:
 
-[.line-through]#
-$con = oci_connect("phpuser", "phpuserpw", "localhost");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
 if (!$con) {
-    $m = oci_error();
-    echo $m['message'], "\n";
-    exit;
+  $m = oci_error();
+  exit('Connect Error ' . $m['message']);
 }
-$query = "select ID from wishers where name = :user_bv";
+$query = "SELECT id FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
 $user = $_POST['user'];
-$wisherID = null;
+
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
 //Each user name should be unique. Check if the submitted user already exists.
-$row = oci_fetch_array($stid, OCI_ASSOC);if ($row) {$wisherID = $row["ID"]; }if ($wisherID != null) {$userNameIsUnique = false;}#
-
-[source,java]
-----
+$row = oci_fetch_array($stid, OCI_ASSOC);
+if ($row) {
+  $userNameIsUnique = false;
+}
 
+// to replace
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
-O objeto  ``WishDB``  existe enquanto a página atual estiver sendo processada. Ele é destruído depois que o processamento é concluído ou interrompido. O código para abrir uma conexão ao banco de dados não é necessário porque isso é feito pela função WishDB. O código para fechar a conexão não é necessário porque a conexão é fechada assim que o objeto  ``WishDB``  é destruído.
-4. Substitua o código que insere novos desejos no banco de dados pelo código que chama a função  ``create_wisher`` .
 
-Para o *banco de dados MySQL*, o código a ser substituído é:
+O objeto  `WishDB`  existe enquanto a página atual estiver sendo processada. Ele é destruído depois que o processamento é concluído ou interrompido. O código para abrir uma conexão ao banco de dados não é necessário porque isso é feito pela função WishDB. O código para fechar a conexão não é necessário porque a conexão é fechada assim que o objeto  `WishDB`  é destruído.
+4. Substitua o código que insere novos desejos no banco de dados pelo código que chama a função  `create_wisher` .
 
-[.line-through]#if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $password = mysqli_real_escape_string($con, $_POST["password"]);mysqli_select_db($con, "wishlist");mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");mysqli_free_result($wisher);mysqli_close($con);header('Location: editWishList.php');exit;}
-                    #
+Para o *banco de dados MySQL*, o código a ser substituído é:
 
-[source,java]
+[source,php]
 ----
 
-                *if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
+// to remove
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+  $password = mysqli_real_escape_string($con, $_POST['password']);
+  mysqli_select_db($con, "wishlist");
+  mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");
+  mysqli_free_result($wisher);
+  mysqli_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
 ----
 
 Para o *banco de dados Oracle*, o código a ser substituído é:
 
-[.line-through]#
-if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($con, $query);
-    $pwd = $_POST['password'];
-    oci_bind_by_name($stid, ':user_bv', $user);
-    oci_bind_by_name($stid, ':pwd_bv', $pwd);
-    oci_execute($stid);
-    oci_close($con);
-    header('Location: editWishList.php');
-    exit;
-}#
-
-[source,java]
+[source,php]
 ----
 
+// to remove
 
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
-*if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
-----
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($con, $query);
+  $pwd = $_POST['password'];
+  oci_bind_by_name($stid, ':user_bv', $user);
+  oci_bind_by_name($stid, ':pwd_bv', $pwd);
+  oci_execute($stid);
+  oci_free_statement($stid);
+  oci_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
 
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
+----
 
 == O código-fonte da Aplicação após a Lição Atual está Concluído
 
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_ru.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_ru.asciidoc
index 5958d89..6803cf3 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_ru.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_ru.asciidoc
@@ -42,26 +42,6 @@
 :keywords: Apache NetBeans, Tutorials, Урок 4: Оптимизация кода путем добавления классов и объектов
 
 
-
-1. link:wish-list-tutorial-main-page.html[+Создание приложения на основе базы данных с помощью языка PHP – главная страница+]
-2. 
-Создание базы данных
-
-1. link:wish-list-lesson1.html[+Создание базы данных MySQL+]
-2. link:wish-list-oracle-lesson1.html[+Создание таблиц базы данных Oracle+]
-3. link:wish-list-lesson2.html[+Проектирование приложения. Чтение из базы данных+]
-4. link:wish-list-lesson3.html[+Создание нового пользователя приложения+]
-5. 
-*=> Оптимизация кода*
-
-6. link:wish-list-lesson5.html[+Добавление функций безопасности. Реализация входа пользователя в приложение+]
-7. link:wish-list-lesson6.html[+Добавление к базе данных новых желаний+]
-8. link:wish-list-lesson7.html[+Обновление и удаление записей в базе данных+]
-9. link:wish-list-lesson8.html[+Усовершенствование внешнего вида приложения с использованием технологии CSS+]
-10. link:wish-list-lesson9.html[+Развертывание приложения на удаленном веб-сервере+]
-
-image::images/netbeans-stamp-80-74-73.png[title="Содержимое этой страницы применимо к IDE NetBeans 7.2, 7.3, 7.4 и 8.0"]
-
 В этом уроке рассматриваются способы оптимизации кода, позволяющие упростить поддержку этого кода в дальнейшем. Данная процедура затрагивает файлы  ``createNewWisher.php``  и  ``wishlist.php`` . Кроме того, создается новый файл под названием  ``db.php`` .
 
 Код приложения содержит несколько похожих блоков с запросами к базе данных. Для упрощения чтения и поддержки кода в будущем можно извлечь эти блоки, реализовать их в качестве функций отдельного класса  ``WishDB``  и поместить текст  ``WishDB``  в файл  ``db.php`` . Впоследствии можно включить файл  ``db.php``  в любой файл PHP и использовать любую <<includedFunctions,функцию класса WishDB>> без дублирования кода. Такой подход гарантирует, что любые изменения в запросах или функциях будут [...]
@@ -75,14 +55,14 @@ image::images/netbeans-stamp-80-74-73.png[title="Содержимое этой 
 Текущий документ является частью краткого учебного курса "Создание приложения CRUD в IDE NetBeans для PHP".
 
 
-
+[[previousLessonSourceCode]]
 == Исходный код приложения из предыдущего урока
 
 Для пользователей MySQL: перейдите по link:https://netbeans.org/files/documents/4/1929/lesson3.zip[+этой ссылке+] для загрузки исходного кода, описывающего состояние проекта на момент завершения предыдущего урока.
 
 Для пользователей Oracle Database: щелкните link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson3.zip[+здесь+] для загрузки исходного кода, отражающего состояние проекта по завершении предыдущего урока.
 
-
+[[createDbPhpFile]]
 == Создание файла db.php
 
 Создайте новую подпапку в папке "Исходные файлы". Дайте папке имя Includes. Создайте новый файл под именем db.php и поместите его в папку Includes. Позже вы сможете добавлять в эту папку файлы, которые будут включаться в другие РНР-файлы.
@@ -95,6 +75,7 @@ image::images/netbeans-stamp-80-74-73.png[title="Содержимое этой 
 4. В поле "Имя файла" введите db. Затем нажмите кнопку "Готово".
 
 
+[[wishDBClass]]
 == Создание класса WishDB
 
 Для создания класса WishDB необходимо инициализировать переменные класса и реализовать конструктор класса. Пользователи MySQL, обратите внимание, что класс WishDB _расширяет_  ``mysqli`` . Это означает, что WishDB _наследует_ функции и другие характеристики класса PHP mysqli. Вы убедитесь в важности этого при добавлении функций  ``mysqli ``  к классу.
@@ -103,40 +84,44 @@ image::images/netbeans-stamp-80-74-73.png[title="Содержимое этой 
 
 *Для базы данных MySQL:*
 
-
-[source,java]
+[[source,php]
 ----
 
 class WishDB extends mysqli {
 
-
     // single instance of self shared among all instances
     private static $instance = null;
 
-
     // db connection config vars
     private $user = "phpuser";
     private $pass = "phpuserpw";
     private $dbName = "wishlist";
     private $dbHost = "localhost";
+
 }
+
 ----
 
 *Для базы данных Oracle:*
 
-
-[source,java]
+[source,php]
 ----
 
-class WishDB {// single instance of self shared among all instances
-private static $instance = null;// db connection config vars
-private $user = "phpuser";
-private $pass = "phpuserpw";
-private $dbName = "wishlist";
-private $dbHost = "localhost/XE";
-private $con = null;}        
-----
+class WishDB {
 
+    // single instance of self shared among all instances
+    private static $instance = null;
+
+    // db connection config vars
+    private $user = "phpuser";
+    private $pass = "phpuserpw";
+    private $dbName = "wishlist";
+    private $dbHost = "localhost/XE";
+    private $con = null;
+
+}
+
+----
 
 [[instantiate-wishdb]]
 == Создание экземпляров класса WishDB
@@ -146,26 +131,32 @@ private $con = null;}
 Внутри класса WishDB введите или вставьте следующий код:
 
 
-[source,java]
+[source,php]
 ----
 
- //This method must be static, and must return an instance of the object if the object
- //does not already exist.
- public static function getInstance() {
-   if (!self::$instance instanceof self) {
-     self::$instance = new self;
-   }
-   return self::$instance;
- }
+// This method must be static, and must return an instance of the object if the object
+// does not already exist.
+
+public static function getInstance() {
+
+  if (!self::$instance instanceof self) {
+    self::$instance = new self;
+  }
+
+  return self::$instance;
+}
+
+// The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
+// thus eliminating the possibility of duplicate objects.
+ 
+public function __clone() {
+  trigger_error('Clone is not allowed.', E_USER_ERROR);
+}
+
+public function __wakeup() {
+  trigger_error('Deserializing is not allowed.', E_USER_ERROR);
+}
 
- // The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
- // thus eliminating the possibility of duplicate objects.
- public function __clone() {
-   trigger_error('Clone is not allowed.', E_USER_ERROR);
- }
- public function __wakeup() {
-   trigger_error('Deserializing is not allowed.', E_USER_ERROR);
- }
 ----
 
 Функция  ``getInstance``  является общедоступной и статической. Общедоступность означает возможность свободного доступа извне класса. Статическая функция доступна даже в том случае, если для класса не было создано экземпляров. Поскольку функция  ``getInstance``  вызывается для создания экземпляров класса, она является статической. Обратите внимание, что эта функция имеет доступ к статической переменной ``$instance``  и устанавливает ее значение как экземпляр класса.
@@ -183,32 +174,47 @@ private $con = null;}
 *Для базы данных MySQL*
 
 
-[source,java]
+[source,php]
 ----
 
-// private constructorprivate function __construct() {parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);if (mysqli_connect_error()) {exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());}parent::set_charset('utf-8');}
+// private constructor
+private function __construct() {
+
+  parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);
+  
+  if (mysqli_connect_error()) {
+    exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
+  }
+
+  parent::set_charset('utf-8');
+}
+
 ----
 
 *Для базы данных Oracle*
 
 
-[source,java]
+[source,php]
 ----
 
 // private constructor
 private function __construct() {
+
     $this->con = oci_connect($this->user, $this->pass, $this->dbHost);
+
     if (!$this->con) {
         $m = oci_error();
         echo $m['message'], "\n";
         exit;
     }
 }
+
 ----
 
 Следует учитывать, что вместо переменных  ``$con`` ,  ``$dbHost`` ,  ``$user``  или  ``$pass``  используется псевдопеременная  ``$this`` . Псевдопеременная  ``$this``  используется при вызове метода внутри контекста объекта. Она ссылается на значение переменной внутри этого объекта.
 
 
+[[includedFunctions]]
 == Функции класса WishDB
 
 В этом уроке рассматривается реализация следующих функций класса WishDB:
@@ -227,34 +233,55 @@ private function __construct() {
 *Для базы данных MySQL*
 
 
-[source,java]
+[[source,php]
 ----
 
-public function get_wisher_id_by_name($name) {$name = $this->real_escape_string($name);$wisher = $this->query("SELECT id FROM wishers WHERE name = '". $name . "'");
-    if ($wisher->num_rows > 0){$row = $wisher->fetch_row();return $row[0];} elsereturn null;
+public function get_wisher_id_by_name($name) {
+  
+  $name = $this->real_escape_string($name);
+  $wisher = $this->query("SELECT id FROM wishers WHERE name = '" . $name . "'");
+
+  if ($wisher->num_rows > 0){
+    $row = $wisher->fetch_row();
+    return $row[0];
+  } else {
+    return null;
+  }
 }
+
 ----
 
 *Для базы данных Oracle*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wisher_id_by_name($name) {
+    
     $query = "SELECT id FROM wishers WHERE name = :user_bv";
     $stid = oci_parse($this->con, $query);
+    
     oci_bind_by_name($stid, ':user_bv', $name);
     oci_execute($stid);
-//Because user is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);if ($row) return $row["ID"];elsereturn null;
+    
+    //Because user is a unique value I only expect one row
+    $row = oci_fetch_array($stid, OCI_ASSOC);
+
+    if ($row) {
+      return $row["ID"];
+    } else {
+      return null;
+    }
 }
+
 ----
+
 Блок кода выполняет запрос  ``SELECT ID FROM wishers WHERE name = [переменная для имени пожелания]`` . Результат запроса - массив идентификаторов из записей, соответствующих запросу. Если массив не пустой, это по умолчанию означает, что он содержит один элемент, поскольку при создании таблицы имя поля было определено как UNIQUE. В этом случае функция возвращает первый элемент массива  ``$result``  (элемент под номером ноль). Если массив пуст, функция возвращает значение "null".
 
 *Примечание к безопасности.* Для базы данных MySQL строка  ``$name ``  используется с с escape-символом для предотвращения атак SQL-инъекций. См. link:http://en.wikipedia.org/wiki/SQL_injection[+статью энциклопедии Wikipedia о введении SQL +] и link:http://us3.php.net/mysql_real_escape_string[+документацию mysql_real_escape_string+]. Несмотря на то, что в контексте этого руководства риск возникновения опасных атак внедрения SQL маловероятен, рекомендуется исключить из участия в запросах  [...]
 
-
+[[getWishesByID]]
 === Функция get_wishes_by_wisher_id
 
 Эта функция возвращает зарегистрированные пожелания пользователя, и для ее выполнения в качестве входного параметра требуется идентификатор пользователя.
@@ -264,25 +291,32 @@ public function get_wisher_id_by_name($name) {
 *Для базы данных MySQL*
 
 
-[source,java]
+[[source,php]
 ----
 
-public function get_wishes_by_wisher_id($wisherID) {return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);}
+public function get_wishes_by_wisher_id($wisherID) {
+  return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+}
+
 ----
 
 *Для базы данных Oracle*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wishes_by_wisher_id($wisherID) {
-    $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ":id_bv", $wisherID);
-    oci_execute($stid);
-    return $stid;
+  
+  $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
+  $stid = oci_parse($this->con, $query);
+  
+  oci_bind_by_name($stid, ":id_bv", $wisherID);
+  oci_execute($stid);
+
+  return $stid;
 }
+
 ----
 
 Блок кода выполняет запрос  ``"SELECT id, description, due_date FROM wishes WHERE wisherID=" . $wisherID``  и возвращает набор результатов, который является массивом записей, соответствующих запросу. (База данных Oracle использует связанную переменную для повышения производительности базы данных и уровня безопасности). Выделение выполняется с помощью wisherID, который является внешним ключом для таблицы  ``wishes`` .
@@ -290,6 +324,7 @@ public function get_wishes_by_wisher_id($wisherID) {
 *Примечание.* Значение  ``идентификатора``  не требуется до занятия 7.
 
 
+[[createWisher]]
 === Функция create_wisher
 
 Функция создает новую запись в таблице "Wishers". Эта функция не возвращает каких-либо данных, и в качестве входных параметров для ее выполнения требуется имя и пароль нового пользователя.
@@ -299,55 +334,74 @@ public function get_wishes_by_wisher_id($wisherID) {
 *Для базы данных MySQL*
 
 
-[source,java]
+[source,php]
 ----
 
-public function create_wisher ($name, $password){
-    $name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$this->query("INSERT INTO wishers (name, password) VALUES ('" . $name . "', '" . $password . "')");
+public function create_wisher ($name, $password) {
+
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+
+  return $this->query("INSERT INTO wishers (name, password) VALUES ('" . $name . "', '" . $password . "')");
 }
+
 ----
 
 *Для базы данных Oracle*
 
 
-[source,java]
+[source,php]
 ----
 
 public function create_wisher($name, $password) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':user_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($this->con, $query);
+
+  oci_bind_by_name($stid, ':user_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
+  return $stid;
 }
+
 ----
+
 Блок кода выполняет запрос  ``"INSERT wishers (Name, Password) VALUES ([переменные представляющие имя и пароль нового пожелания])`` . При выполнении запроса добавляется новая запись в таблицу "Wishers" с полями "name" и "password", заполненными значениями  ``$name``  и  ``$password``  соответственно.
 
 
+[[refactoring]]
 == Реорганизация кода приложения
 
 Теперь при наличии отдельного класса для работы с базой данных дублированные блоки можно заменить вызовами соответствующих функций из этого класса. Это помогает в дальнейшем избежать ошибок и противоречий в написании кода. Усовершенствование кода, не оказывающее влияния на функциональные возможности, называется "реорганизацией".
 
-
+[[refactoringWishlistFile]]
 === Реорганизация файла wishlist.php
 
 Начнем с файла wishlist.php, поскольку он небольшой и дает возможность представить оптимизацию более иллюстративно.
 
 1. В верхней части блока <? php? > введите следующую строку, делающую возможным использование файла  ``db.php`` :
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
+
 ----
+
 2. Замените код, который подключается к базе данных и получает идентификатор пожелания, вызовом функции  ``get_wisher_id_by_name`` .
 
-Для *базы данных MySQL * вы заменяете следующий код:
+Для *базы данных MySQL* вы заменяете следующий код:
+
+[source,php]
+----
+
+// to remove
 
-[.line-through]#$con = mysqli_connect("localhost", "phpuser", "phpuserpw");
+ $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
@@ -356,43 +410,58 @@ mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_GET['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='" . $user . "'");
 if (mysqli_num_rows($wisher) < 1) {
-    exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
+  exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
 }
-$row = mysqli_fetch_row($wisher);$wisherID = $row[0];
-mysqli_free_result($wisher);#
+$row = mysqli_fetch_row($wisher);
+$wisherID = $row[0];
+mysqli_free_result($wisher);
+
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
+----
 
 Для *базы данных Oracle * вы заменяете следующий код:
 
-[.line-through]#$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE");
 if (!$con) {
-   $m = oci_error();
-   echo $m['message'], "\n";
-   exit;
-}
-$query = "SELECT id FROM wishers WHERE name = :user_bv";
+  $m = oci_error();
+  echo $m['message'], "\n";
+  exit;
+}        
+$query = "SELECT ID FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
-$user = $_GET["user"];
+$user = $_GET['user'];
 
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
-//Because user is a unique value I only expect one row$row = oci_fetch_array($stid, OCI_ASSOC);
+//Because user is a unique value I only expect one row
+$row = oci_fetch_array($stid, OCI_ASSOC);
 if (!$row) {
-    echo("The person " . $user . " is not found. Please check the spelling and try again" );exit;}
-$wisherID = $row["ID"]; #
+  echo("The person " . $user . " is not found. Please check the spelling and try again" );
+  exit;
+}
+$wisherID = $row['ID']; 
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
 ----
 
 Новый код сначала вызывает функцию  ``getInstance``  в WishDB. Функция  ``getInstance``  возвращает экземпляр WishDB, а код вызывает функцию  ``get_wisher_id_by_name``  в пределах данного экземпляра. Если требуемое пожелание в базе данных не найдено, код завершает процесс и отображает сообщение об ошибке.
@@ -403,159 +472,203 @@ if (!$wisherID) {
 
 Для *базы данных MySQL * вы заменяете следующий код:
 
-[.line-through]#$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=". $wisherID);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+
+// to replace      
+ 
+$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
 
 Для *базы данных Oracle * вы заменяете следующий код:
 
-[.line-through]#$query = "select * from wishes where wisher_id = :id_bv";$stid = oci_parse($con, $query);oci_bind_by_name($stid, ":id_bv", $wisherID);oci_execute($stid);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$query = "SELECT description, due_date FROM wishes WHERE wisher_id = :id_bv";
+$stid = oci_parse($con, $query);
+oci_bind_by_name($stid, ":id_bv", $wisherID);
+oci_execute($stid);
+
+// to replace
+
+$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
+
 4. Удалите строку, которая закрывает подключение к базе данных.
 
-[source,java]
+[source,php]
 ----
 
- [.line-through]#mysqli_close($con);#
-                    or
- [.line-through]#oci_close($con);#                
-----
-Код не нужен, потому что подключение к базе данных автоматически закрывается при уничтожении объекта WishDB. Однако рекомендуем сохранять код, освобождающий ресурс. Вам необходимо освободить все ресурсы, которые используют подключение, чтобы убедиться в том, что оно закрыто, даже при вызове функции  ``close``  или уничтожении экземпляра с подключением к базе данных.
+// For MYSQL database
+mysqli_close($con);
 
+// For Oracle database
+oci_close($con);
 
-===  
+----
+
+Код не нужен, потому что подключение к базе данных автоматически закрывается при уничтожении объекта WishDB. Однако рекомендуем сохранять код, освобождающий ресурс. Вам необходимо освободить все ресурсы, которые используют подключение, чтобы убедиться в том, что оно закрыто, даже при вызове функции  ``close``  или уничтожении экземпляра с подключением к базе данных.
 
 
+[[refactoringCreateNewWisher]]
 === Реорганизация файла createNewWisher.php
 
 Реорганизация не оказывает воздействия на форму ввода HTML или код для вывода на экран соответствующих сообщений об ошибках.
 
 1. В верхней части блока <? php? > введите следующий код, делающий возможным использование файла  ``db.php`` :
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
+
 ----
+
 2. Удалите подтверждения подключения к базе данных ( ``$dbHost``  и пр.). Теперь они находятся в ``db.php`` .
 3. Замените код, который подключается к базе данных и получает идентификатор пожелания, вызовом функции  ``get_wisher_id_by_name`` .
 
 Для *базы данных MySQL * вы заменяете следующий код:
 
-[.line-through]#
+[source,php]
+----
+
+// to remove
+
 $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
 
-
 /** Check whether a user whose name matches the "user" field already exists */
 mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_POST['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='".$user."'");
 $wisherIDnum=mysqli_num_rows($wisher);
 if ($wisherIDnum) {
-   $userNameIsUnique = false;
-}#
+  $userNameIsUnique = false;
+}
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
 
 Для *базы данных Oracle * вы заменяете следующий код:
 
-[.line-through]#
-$con = oci_connect("phpuser", "phpuserpw", "localhost");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
 if (!$con) {
-    $m = oci_error();
-    echo $m['message'], "\n";
-    exit;
+  $m = oci_error();
+  exit('Connect Error ' . $m['message']);
 }
-$query = "select ID from wishers where name = :user_bv";
+$query = "SELECT id FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
 $user = $_POST['user'];
-$wisherID = null;
+
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
 //Each user name should be unique. Check if the submitted user already exists.
-$row = oci_fetch_array($stid, OCI_ASSOC);if ($row) {$wisherID = $row["ID"]; }if ($wisherID != null) {$userNameIsUnique = false;}#
-
-[source,java]
-----
+$row = oci_fetch_array($stid, OCI_ASSOC);
+if ($row) {
+  $userNameIsUnique = false;
+}
 
+// to replace
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
 Объект  ``WishDB``  существует до тех пор, пока обрабатывается текущая страница. Если обработка завершена или прервана, этот объект уничтожается. Код для открытия подключения к базе данных не является необходимым, поскольку подключение выполняется посредством функции WishDB. Код для закрытия подключения также не является необходимым, поскольку подключение будет закрыто сразу же после уничтожения объекта  ``WishDB`` .
 4. Замените код, который вставляет новых авторов пожеланий в базу данных, кодом, который вызывает функцию  ``create_wisher`` .
 
 Для *базы данных MySQL * вы заменяете следующий код:
 
-[.line-through]#if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $password = mysqli_real_escape_string($con, $_POST["password"]);mysqli_select_db($con, "wishlist");mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");mysqli_free_result($wisher);mysqli_close($con);header('Location: editWishList.php');exit;}
-                    #
-
-[source,java]
+[source,php]
 ----
 
-                *if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
+// to remove
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+  $password = mysqli_real_escape_string($con, $_POST['password']);
+  mysqli_select_db($con, "wishlist");
+  mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");
+  mysqli_free_result($wisher);
+  mysqli_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
 ----
 
 Для *базы данных Oracle * вы заменяете следующий код:
 
-[.line-through]#
-if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($con, $query);
-    $pwd = $_POST['password'];
-    oci_bind_by_name($stid, ':user_bv', $user);
-    oci_bind_by_name($stid, ':pwd_bv', $pwd);
-    oci_execute($stid);
-    oci_close($con);
-    header('Location: editWishList.php');
-    exit;
-}#
-
-[source,java]
+[source,php]
 ----
 
+// to remove
 
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
-*if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
-----
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($con, $query);
+  $pwd = $_POST['password'];
+  oci_bind_by_name($stid, ':user_bv', $user);
+  oci_bind_by_name($stid, ':pwd_bv', $pwd);
+  oci_execute($stid);
+  oci_free_statement($stid);
+  oci_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
+----
 
+[[lessonResultSourceCode]]
 == Исходный код приложения на момент завершения текущего урока
 
 Для пользователей MySQL: щелкните link:https://netbeans.org/projects/www/downloads/download/php%252Flesson4.zip[+сюда+] для загрузки исходного кода, отражающего состояние проекта по завершении данного урока.
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_zh_CN.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_zh_CN.asciidoc
index ee46f2a..220c5ef 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_zh_CN.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson4_zh_CN.asciidoc
@@ -42,26 +42,6 @@
 :keywords: Apache NetBeans, Tutorials, 第 4 课:使用类和对象优化代码
 
 
-
-1. link:wish-list-tutorial-main-page.html[+使用 PHP 创建数据库驱动的应用程序 - 主页+]
-2. 
-创建数据库
-
-1. link:wish-list-lesson1.html[+创建 MySQL 数据库+]
-2. link:wish-list-oracle-lesson1.html[+创建 Oracle 数据库表+]
-3. link:wish-list-lesson2.html[+设计应用程序。从数据库读取数据+]
-4. link:wish-list-lesson3.html[+创建新的应用程序用户+]
-5. 
-*=> 优化代码*
-
-6. link:wish-list-lesson5.html[+添加安全功能。实现应用程序用户登录+]
-7. link:wish-list-lesson6.html[+在数据库中添加新的愿望+]
-8. link:wish-list-lesson7.html[+更新和删除数据库中的条目+]
-9. link:wish-list-lesson8.html[+使用 CSS 技术改进应用程序的外观+]
-10. link:wish-list-lesson9.html[+将应用程序部署到远程 Web 服务器+]
-
-image::images/netbeans-stamp-80-74-73.png[title="此页上的内容适用于 NetBeans IDE 7.2、7.3、7.4 和 8.0"]
-
 在本课中,将优化代码以便于将来进行维护。这会影响  ``createNewWisher.php``  和  ``wishlist.php``  文件。此外,还会创建一个名为  ``db.php``  的新文件。
 
 应用程序代码包含几个类似的块,其中提供了一些数据库查询。为了便于将来阅读和维护代码,您可以提取这些块,将这些块作为名为  ``WishDB``  的单独类的函数进行实现,然后将  ``WishDB``  放在  ``db.php``  中。接下来,您可以将  ``db.php``  文件包含在任何 PHP 文件中,然后使用 <<includedFunctions,WishDB 中的任何函数>>而无需复制代码。这种方法确保了对查询或函数进行的任何更改是在一个地方完成的,您不必解析整个应用程序代码。
@@ -75,7 +55,7 @@ image::images/netbeans-stamp-80-74-73.png[title="此页上的内容适用于 Net
 当前文档是“在适用于 PHP 的 NetBeans IDE 中创建 CRUD 应用程序”教程的一部分。
 
 
-
+[[previousLessonSourceCode]]
 == 来自上一课的应用程序源代码
 
 MySQL 用户:单击link:https://netbeans.org/files/documents/4/1929/lesson3.zip[+此处+]以下载源代码,该代码反映了在完成上一课之后的项目状态。
@@ -83,6 +63,7 @@ MySQL 用户:单击link:https://netbeans.org/files/documents/4/1929/lesson3.zi
 Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson3.zip[+此处+]以下载源代码,该代码反映了在完成上一课之后的项目状态。
 
 
+[[createDbPhpFile]]
 == 创建 db.php 文件
 
 在 "Source Files"(源文件)文件夹中创建一个新子文件夹。将该文件夹命名为 Includes。创建一个名为 db.php 的新文件,并将其放在 Includes 中。然后,您可以在该文件夹中添加更多文件,这些文件将包含在其他 PHP 文件中。
@@ -95,6 +76,7 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 4. 在 "File Name"(文件名)字段中,键入 db。然后,单击 "Finish"(完成)。
 
 
+[[wishDBClass]]
 == 创建 WishDB 类
 
 要创建 WishDB 类,您需要初始化该类的变量,并实现该类的构造函数。MySQL 用户请注意,WishDB 类_扩展_了  ``mysqli`` 。这意味着 WishDB _继承_ PHP mysqli 类的函数和其他特性。在类中添加  ``mysqli `` 函数时,您会看到这种继承的重要性。
@@ -104,39 +86,45 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 *对于 MySQL 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
 class WishDB extends mysqli {
 
-
     // single instance of self shared among all instances
     private static $instance = null;
 
-
     // db connection config vars
     private $user = "phpuser";
     private $pass = "phpuserpw";
     private $dbName = "wishlist";
     private $dbHost = "localhost";
+
 }
+
 ----
 
 *对于 Oracle 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
-class WishDB {// single instance of self shared among all instances
-private static $instance = null;// db connection config vars
-private $user = "phpuser";
-private $pass = "phpuserpw";
-private $dbName = "wishlist";
-private $dbHost = "localhost/XE";
-private $con = null;}        
-----
+class WishDB {
+
+    // single instance of self shared among all instances
+    private static $instance = null;
+
+    // db connection config vars
+    private $user = "phpuser";
+    private $pass = "phpuserpw";
+    private $dbName = "wishlist";
+    private $dbHost = "localhost/XE";
+    private $con = null;
 
+}
+
+----
 
 [[instantiate-wishdb]]
 == 实例化 WishDB 类
@@ -146,26 +134,32 @@ private $con = null;}
 在 WishDB 类中,键入或粘贴以下代码:
 
 
-[source,java]
+[source,php]
 ----
 
- //This method must be static, and must return an instance of the object if the object
- //does not already exist.
- public static function getInstance() {
-   if (!self::$instance instanceof self) {
-     self::$instance = new self;
-   }
-   return self::$instance;
- }
+// This method must be static, and must return an instance of the object if the object
+// does not already exist.
+
+public static function getInstance() {
+
+  if (!self::$instance instanceof self) {
+    self::$instance = new self;
+  }
+
+  return self::$instance;
+}
+
+// The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
+// thus eliminating the possibility of duplicate objects.
+ 
+public function __clone() {
+  trigger_error('Clone is not allowed.', E_USER_ERROR);
+}
+
+public function __wakeup() {
+  trigger_error('Deserializing is not allowed.', E_USER_ERROR);
+}
 
- // The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
- // thus eliminating the possibility of duplicate objects.
- public function __clone() {
-   trigger_error('Clone is not allowed.', E_USER_ERROR);
- }
- public function __wakeup() {
-   trigger_error('Deserializing is not allowed.', E_USER_ERROR);
- }
 ----
 
  ``getInstance``  函数为 "public" 和 "static"。"Public" 表示可以从类外部任意访问该函数。"Static" 表示即使未实例化类,也可以使用该函数。在调用  ``getInstance``  函数以实例化类时,该函数必须是静态的。请注意,该函数访问静态  ``$instance``  变量,并将其值设置为类实例。
@@ -183,32 +177,48 @@ private $con = null;}
 *对于 MySQL 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
-// private constructorprivate function __construct() {parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);if (mysqli_connect_error()) {exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());}parent::set_charset('utf-8');}
+// private constructor
+private function __construct() {
+
+  parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);
+  
+  if (mysqli_connect_error()) {
+    exit('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
+  }
+
+  parent::set_charset('utf-8');
+}
+
 ----
 
 *对于 Oracle 数据库:*
 
 
-[source,java]
+*For the Oracle database:*
+
+[source,php]
 ----
 
 // private constructor
 private function __construct() {
+
     $this->con = oci_connect($this->user, $this->pass, $this->dbHost);
+
     if (!$this->con) {
         $m = oci_error();
         echo $m['message'], "\n";
         exit;
     }
 }
+
 ----
 
 请注意,使用了伪变量  ``$this`` ,而不是使用  ``$con`` 、 ``$dbHost`` 、 ``$user``  或  ``$pass``  变量。从对象上下文中调用方法时,将使用伪变量  ``$this`` 。它引用该对象中的变量值。
 
-
+[[includedFunctions]]
 == WishDB 类中的函数
 
 在本课中,将实现 WishDB 类的以下函数:
@@ -217,7 +227,7 @@ private function __construct() {
 * <<getWishesByID,get_wishes_by_wisher_id>> - 使用特定 ID 检索许愿者的愿望列表
 * <<createWisher,create_wisher>> - 将新许愿者记录添加到 wishers 表中
 
-
+[[getIDByName]]
 === 函数 get_wisher_id_by_name
 
 该函数要求将许愿者名字作为输入参数,并返回许愿者的 ID。 
@@ -227,34 +237,55 @@ private function __construct() {
 *对于 MySQL 数据库:*
 
 
-[source,java]
+[[source,php]
 ----
 
-public function get_wisher_id_by_name($name) {$name = $this->real_escape_string($name);$wisher = $this->query("SELECT id FROM wishers WHERE name = '". $name . "'");
-    if ($wisher->num_rows > 0){$row = $wisher->fetch_row();return $row[0];} elsereturn null;
+public function get_wisher_id_by_name($name) {
+  
+  $name = $this->real_escape_string($name);
+  $wisher = $this->query("SELECT id FROM wishers WHERE name = '" . $name . "'");
+
+  if ($wisher->num_rows > 0){
+    $row = $wisher->fetch_row();
+    return $row[0];
+  } else {
+    return null;
+  }
 }
+
 ----
 
 *对于 Oracle 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wisher_id_by_name($name) {
+    
     $query = "SELECT id FROM wishers WHERE name = :user_bv";
     $stid = oci_parse($this->con, $query);
+    
     oci_bind_by_name($stid, ':user_bv', $name);
     oci_execute($stid);
-//Because user is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);if ($row) return $row["ID"];elsereturn null;
+    
+    //Because user is a unique value I only expect one row
+    $row = oci_fetch_array($stid, OCI_ASSOC);
+
+    if ($row) {
+      return $row["ID"];
+    } else {
+      return null;
+    }
 }
+
 ----
+
 该代码块执行  ``SELECT ID FROM wishers WHERE name = [variable for name of the wisher]``  查询。查询结果是一个数组,其中包含符合查询条件的记录中的 ID。如果该数组不为空,则自动表示它包含一个元素,这是因为在创建表期间将字段名称指定为 UNIQUE。在本示例中,该函数返回  ``$result``  数组的第一个元素(编号为零的元素)。如果数组为空,该函数将返回空值。
 
 *安全注意事项:*对于 MySQL 数据库,将转义  ``$name``  字符串以防止 SQL 注入攻击。请参见link:http://en.wikipedia.org/wiki/SQL_injection[+有关 SQL 注入的维基百科+]和 link:http://us3.php.net/mysql_real_escape_string[+mysql_real_escape_string 文档+]。虽然在本教程的上下文中,您不会遇到有害 SQL 注入的风险,但最佳做法是转义存在此类攻击风险的 MySQL 查询中的字符串。Oracle 数据库通过使用绑定变量来避免该问题。
 
-
+[[getWishesByID]]
 === 函数 get_wishes_by_wisher_id
 
 该函数要求将许愿者 ID 作为输入参数,并返回为许愿者注册的愿望。
@@ -264,32 +295,39 @@ public function get_wisher_id_by_name($name) {
 *对于 MySQL 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function get_wishes_by_wisher_id($wisherID) {return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);}
+public function get_wishes_by_wisher_id($wisherID) {
+  return $this->query("SELECT id, description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+}
+
 ----
 
 *对于 Oracle 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wishes_by_wisher_id($wisherID) {
-    $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ":id_bv", $wisherID);
-    oci_execute($stid);
-    return $stid;
+  
+  $query = "SELECT id, description, due_date FROM wishes WHERE wisher_id = :id_bv";
+  $stid = oci_parse($this->con, $query);
+  
+  oci_bind_by_name($stid, ":id_bv", $wisherID);
+  oci_execute($stid);
+
+  return $stid;
 }
+
 ----
 
 该代码块执行  ``"SELECT id, description, due_date FROM wishes WHERE wisherID=" . $wisherID``  查询并返回一个结果集,这是一个符合查询条件的记录数组。(出于数据库性能和安全考虑,Oracle 数据库使用绑定变量。)数据选择是按 wisherID 执行的,这是  ``wishes``  表的外键。
 
 *注:*在第 7 课之前,您不需要使用  ``id``  值。
 
-
+[[createWisher]]
 === 函数 create_wisher
 
 该函数在 wishers 表中创建一个新记录。该函数要求将新许愿者的名字和口令作为输入参数,并且不返回任何数据。
@@ -299,55 +337,72 @@ public function get_wishes_by_wisher_id($wisherID) {
 *对于 MySQL 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function create_wisher ($name, $password){
-    $name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$this->query("INSERT INTO wishers (name, password) VALUES ('" . $name . "', '" . $password . "')");
+public function create_wisher ($name, $password) {
+
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+
+  return $this->query("INSERT INTO wishers (name, password) VALUES ('" . $name . "', '" . $password . "')");
 }
+
 ----
 
 *对于 Oracle 数据库:*
 
-
-[source,java]
+[source,php]
 ----
 
 public function create_wisher($name, $password) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':user_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($this->con, $query);
+
+  oci_bind_by_name($stid, ':user_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
+  return $stid;
 }
+
 ----
-该代码块执行  ``"INSERT wishers (Name, Password) VALUES ([variables representing name and password of new wisher])``  查询。该查询在 "wishers" 表中添加一个新记录,并分别使用  ``$name``  和  ``$password``  值填充 "name" 和 "password" 字段。
 
+该代码块执行  ``"INSERT wishers (Name, Password) VALUES ([variables representing name and password of new wisher])``  查询。该查询在 "wishers" 表中添加一个新记录,并分别使用  ``$name``  和  ``$password``  值填充 "name" 和 "password" 字段。
 
+[[refactoring]]
 == 重构应用程序代码
 
 现在,您已创建了一个单独的类以使用数据库,接下来便可将重复的块替换为对该类中的相关函数的调用。这有助于避免将来出现拼写错误和不一致的情况。不影响功能的代码优化称为“重构”。
 
-
+[[refactoringWishlistFile]]
 === 重构 wishlist.php 文件
 
 请从 wishlist.php 文件入手,因为该文件很短,改进更能说明问题。
 
 1. 在 <?php ?> 块的顶部,输入以下行以允许使用  ``db.php``  文件:
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
+
 ----
+
 2. 将连接到数据库并获取许愿者 ID 的代码替换为  ``get_wisher_id_by_name``  函数调用。
 
 对于 *MySQL 数据库*,替换的代码为:
 
-[.line-through]#$con = mysqli_connect("localhost", "phpuser", "phpuserpw");
+[source,php]
+----
+
+// to remove
+
+ $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
@@ -356,43 +411,58 @@ mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_GET['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='" . $user . "'");
 if (mysqli_num_rows($wisher) < 1) {
-    exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
+  exit("The person " . $_GET['user'] . " is not found. Please check the spelling and try again");
 }
-$row = mysqli_fetch_row($wisher);$wisherID = $row[0];
-mysqli_free_result($wisher);#
+$row = mysqli_fetch_row($wisher);
+$wisherID = $row[0];
+mysqli_free_result($wisher);
+
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
+----
 
 对于 *Oracle 数据库*,替换的代码为:
 
-[.line-through]#$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE");
 if (!$con) {
-   $m = oci_error();
-   echo $m['message'], "\n";
-   exit;
-}
-$query = "SELECT id FROM wishers WHERE name = :user_bv";
+  $m = oci_error();
+  echo $m['message'], "\n";
+  exit;
+}        
+$query = "SELECT ID FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
-$user = $_GET["user"];
+$user = $_GET['user'];
 
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
-//Because user is a unique value I only expect one row$row = oci_fetch_array($stid, OCI_ASSOC);
+//Because user is a unique value I only expect one row
+$row = oci_fetch_array($stid, OCI_ASSOC);
 if (!$row) {
-    echo("The person " . $user . " is not found. Please check the spelling and try again" );exit;}
-$wisherID = $row["ID"]; #
+  echo("The person " . $user . " is not found. Please check the spelling and try again" );
+  exit;
+}
+$wisherID = $row['ID']; 
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_GET["user"]);
 if (!$wisherID) {
-    exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
-}*
+  exit("The person " .$_GET["user"]. " is not found. Please check the spelling and try again" );
+}
+
 ----
 
 新代码先调用 WishDB 中的  ``getInstance``  函数。 ``getInstance``  函数返回一个 WishDB 实例,然后代码在该实例中调用  ``get_wisher_id_by_name``  函数。如果在数据库中找不到请求的许愿者,代码将终止该进程,然后显示一条错误消息。
@@ -403,159 +473,204 @@ if (!$wisherID) {
 
 对于 *MySQL 数据库*,替换的代码为:
 
-[.line-through]#$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=". $wisherID);#
-
-[source,java]
+[[source,php]
 ----
 
-                
-*$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$result = mysqli_query($con, "SELECT description, due_date FROM wishes WHERE wisher_id=" . $wisherID);
+
+// to replace      
+ 
+$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
 
 对于 *Oracle 数据库*,替换的代码为:
 
-[.line-through]#$query = "select * from wishes where wisher_id = :id_bv";$stid = oci_parse($con, $query);oci_bind_by_name($stid, ":id_bv", $wisherID);oci_execute($stid);#
-
-[source,java]
+[source,php]
 ----
 
-                
-*$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);*
+// to remove
+
+$query = "SELECT description, due_date FROM wishes WHERE wisher_id = :id_bv";
+$stid = oci_parse($con, $query);
+oci_bind_by_name($stid, ":id_bv", $wisherID);
+oci_execute($stid);
+
+// to replace
+
+$stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+
 ----
+
 4. 删除关闭数据库连接的行。
 
-[source,java]
+[source,php]
 ----
 
- [.line-through]#mysqli_close($con);#
-                    or
- [.line-through]#oci_close($con);#                
-----
-不需要该代码,因为在销毁 WishDB 对象时自动关闭数据库连接。不过,保留了释放资源的代码。即使您调用了  ``close``  函数或销毁了使用数据库连接的实例,也需要释放使用连接的所有资源以确保正确关闭连接。
+// For MYSQL database
+mysqli_close($con);
 
+// For Oracle database
+oci_close($con);
 
-===  
+----
+
+不需要该代码,因为在销毁 WishDB 对象时自动关闭数据库连接。不过,保留了释放资源的代码。即使您调用了  ``close``  函数或销毁了使用数据库连接的实例,也需要释放使用连接的所有资源以确保正确关闭连接。
 
 
+[[refactoringCreateNewWisher]]
 === 重构 createNewWisher.php 文件
 
 重构不影响 HTML 输入窗体或显示相关错误消息的代码。
 
 1. 在 <?php?> 块的顶部,输入以下代码以允许使用  ``db.php``  文件:
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
+
 ----
+
 2. 删除数据库连接凭证( ``$dbHost``  等)。这些凭证现在包含在  ``db.php``  中。
 3. 将连接到数据库并获取许愿者 ID 的代码替换为  ``get_wisher_id_by_name``  函数调用。
 
 对于 *MySQL 数据库*,替换的代码为:
 
-[.line-through]#
+[source,php]
+----
+
+// to remove
+
 $con = mysqli_connect("localhost", "phpuser", "phpuserpw");
 if (!$con) {
-    exit('Connect Error (' . mysqli_connect_errno() . ') '
-            . mysqli_connect_error());
+  exit('Connect Error (' . mysqli_connect_errno() . ') '
+          . mysqli_connect_error());
 }
 //set the default client character set 
 mysqli_set_charset($con, 'utf-8');
 
-
 /** Check whether a user whose name matches the "user" field already exists */
 mysqli_select_db($con, "wishlist");
 $user = mysqli_real_escape_string($con, $_POST['user']);
 $wisher = mysqli_query($con, "SELECT id FROM wishers WHERE name='".$user."'");
 $wisherIDnum=mysqli_num_rows($wisher);
 if ($wisherIDnum) {
-   $userNameIsUnique = false;
-}#
+  $userNameIsUnique = false;
+}
 
-[source,java]
-----
+// to replace
+
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
 
 对于 *Oracle 数据库*,替换的代码为:
 
-[.line-through]#
-$con = oci_connect("phpuser", "phpuserpw", "localhost");
+[source,php]
+----
+
+// to remove
+
+$con = oci_connect("phpuser", "phpuserpw", "localhost/XE", "AL32UTF8");
 if (!$con) {
-    $m = oci_error();
-    echo $m['message'], "\n";
-    exit;
+  $m = oci_error();
+  exit('Connect Error ' . $m['message']);
 }
-$query = "select ID from wishers where name = :user_bv";
+$query = "SELECT id FROM wishers WHERE name = :user_bv";
 $stid = oci_parse($con, $query);
 $user = $_POST['user'];
-$wisherID = null;
+
 oci_bind_by_name($stid, ':user_bv', $user);
 oci_execute($stid);
 
 //Each user name should be unique. Check if the submitted user already exists.
-$row = oci_fetch_array($stid, OCI_ASSOC);if ($row) {$wisherID = $row["ID"]; }if ($wisherID != null) {$userNameIsUnique = false;}#
-
-[source,java]
-----
+$row = oci_fetch_array($stid, OCI_ASSOC);
+if ($row) {
+  $userNameIsUnique = false;
+}
 
+// to replace
 
-*$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_POST["user"]);
 if ($wisherID) {
-$userNameIsUnique = false;
-}*
+  $userNameIsUnique = false;
+}
+
 ----
+
 只要处理当前页面, ``WishDB``  对象就会存在。在处理完成或中断后,将销毁该对象。不需要用于打开数据库连接的代码,因为该操作是由 WishDB 函数完成的。不需要用于关闭连接的代码,因为在销毁  ``WishDB``  对象后,将立即关闭连接。
 4. 将在数据库中插入新许愿者的代码替换为调用  ``create_wisher``  函数的代码。
 
 对于 *MySQL 数据库*,替换的代码为:
 
-[.line-through]#if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $password = mysqli_real_escape_string($con, $_POST["password"]);mysqli_select_db($con, "wishlist");mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");mysqli_free_result($wisher);mysqli_close($con);header('Location: editWishList.php');exit;}
-                    #
-
-[source,java]
+[source,php]
 ----
 
-                *if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
+// to remove
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+  $password = mysqli_real_escape_string($con, $_POST['password']);
+  mysqli_select_db($con, "wishlist");
+  mysqli_query($con, "INSERT wishers (name, password) VALUES ('" . $user . "', '" . $password . "')");
+  mysqli_free_result($wisher);
+  mysqli_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
+
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
 ----
 
 对于 *Oracle 数据库*,替换的代码为:
 
-[.line-through]#
-if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-    $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
-    $stid = oci_parse($con, $query);
-    $pwd = $_POST['password'];
-    oci_bind_by_name($stid, ':user_bv', $user);
-    oci_bind_by_name($stid, ':pwd_bv', $pwd);
-    oci_execute($stid);
-    oci_close($con);
-    header('Location: editWishList.php');
-    exit;
-}#
-
-[source,java]
+[source,php]
 ----
 
+// to remove
 
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
-*if (!$userIsEmpty &amp;&amp; $userNameIsUnique &amp;&amp; !$passwordIsEmpty &amp;&amp; !$password2IsEmpty &amp;&amp; $passwordIsValid) {
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
-header('Location: editWishList.php' );
-exit;
-}*
-----
+  $query = "INSERT INTO wishers (name, password) VALUES (:user_bv, :pwd_bv)";
+  $stid = oci_parse($con, $query);
+  $pwd = $_POST['password'];
+  oci_bind_by_name($stid, ':user_bv', $user);
+  oci_bind_by_name($stid, ':pwd_bv', $pwd);
+  oci_execute($stid);
+  oci_free_statement($stid);
+  oci_close($con);
+  header('Location: editWishList.php');
+  exit;
+}
+
+// to replace
+
+if (!$userIsEmpty && $userNameIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) {
 
+  WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+
+  header('Location: editWishList.php' );
+  exit;
+}
+
+----
 
+[[lessonResultSourceCode]]
 == 完成当前课程后的应用程序源代码
 
 MySQL 用户:单击link:https://netbeans.org/projects/www/downloads/download/php%252Flesson4.zip[+此处+]以下载源代码,该代码反映了在完成课程后的项目状态。
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5.asciidoc
index 681c08a..7080681 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5.asciidoc
@@ -40,112 +40,78 @@
 :description: Lesson 5: Adding Security. Implementing Application User Logon - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, Lesson 5: Adding Security. Implementing Application User Logon
 
-
-Tutorial contents:
-
-1. link:wish-list-tutorial-main-page.html[+Creating a Database Driven Application With PHP - Main page+]
-2. 
-Creating the Database
-
-1. link:wish-list-lesson1.html[+Creating a MySQL Database+]
-2. link:wish-list-oracle-lesson1.html[+Creating Oracle Database Tables+]
-3. link:wish-list-lesson2.html[+Designing the Application. Reading from the Database +]
-4. link:wish-list-lesson3.html[+Creating a New Application User+]
-5. link:wish-list-lesson4.html[+ Optimizing the Code+]
-6. 
-*=> Adding Security. Implementing Application User Logon*
-
-* <<previousLessonSourceCode,Application Source Code from the Previous Lesson>>
-* <<savingWisherIDInSessionUponCreation,Saving the Wisher's ID in the Session Upon Creation>>
-* <<validateWisherLogon,Validating User Logon>>
-* <<retrievingUserNameFromSession,Retrieving the wisher's name from the Session>>
-* <<redirectingNotLoggedInUserToIndexPage,Redirecting a User Who Is Not Logged In>>
-* <<logonFromIndexPage,Logging In from the index.php Page>>
-* <<logonForm,HTML Form for Logon on index.php>>
-* <<logonValidation,Logon Validation>>
-* <<verifyWisherCredentials,Function verify_wisher_credentials>>
-* <<displayErrorMessage,Displaying Error Messages>>
-* <<testingLogonFromIndexPage,Testing the Logon from the index.php Page>>
-* <<lessonResultSourceCode,Application Source Code after the Current Lesson Is Completed>>
-7. link:wish-list-lesson6.html[+Adding a New Wish to the Database+]
-8. link:wish-list-lesson7.html[+Updating and Deleting Entries in the Database+]
-9. link:wish-list-lesson8.html[+Making the Application Look Better Using the CSS Technology+]
-10. link:wish-list-lesson9.html[+Deploying the Application on a Remote Web Server+]
-
-image::images/netbeans-stamp-80-74-73.png[title="Content on this page applies to the NetBeans IDE 7.2, 7.3, 7.4 and 8.0"]
-
 In this lesson you implement the logon functionality for a wisher. This affects the following files:
 
-*  ``index.php`` 
-*  ``createNewWisher.php`` 
-*  ``editWishlist.php`` 
-*  ``db.php`` 
+*  `index.php` 
+*  `createNewWisher.php` 
+*  `editWishlist.php` 
+*  `db.php` 
 
 Implementing the logon functionality consists of the following steps:
 
-1. <<savingWisherIDInSessionUponCreation,Saving the wisher's ID in the Session upon the creation of a wisher>>
-2. <<validateWisherLogon,Validating that the user who attempts to edit a wish list is logged in>>
-3. <<logonFromIndexPage,Logging on wisher from the index.php page>>
+1. <<_saving_the_wisher_s_id_in_the_session_upon_creation,Saving the wisher's ID in the Session upon the creation of a wisher>>
+2. <<_validating_user_logon,Validating that the user who attempts to edit a wish list is logged in>>
+3. <<_html_form_for_logon_on_index_php,Logging on wisher from the index.php page>>
 
 The current document is a part of the Creating a CRUD Application in the NetBeans IDE for PHP tutorial.
 
 
-
+[[_application_source_code_from_the_previous_lesson]]
 == Application Source Code from the Previous Lesson
 
 MySQL users: Click link:https://netbeans.org/files/documents/4/1930/lesson4.zip[+here+] to download the source code that reflects the project state after the previous lesson is completed.
 
-Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson4.zip[+ here+] to download the source code that reflects the project state after the previous lesson is completed.
-
+Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson4.zip[+here+] to download the source code that reflects the project state after the previous lesson is completed.
 
+[[_saving_the_wisher_s_id_in_the_session_upon_creation]]
 == Saving the Wisher's ID in the Session Upon Creation
 
-A link:http://us2.php.net/manual/en/ref.session.php[+Session+] is persistent storage for transferring information from one page to another without using an link:wish-list-lesson5.html#htmlForm[+HTML input form+]. This functionality is supported through the predefined PHP array  ``$_SESSION`` .
+A link:http://us2.php.net/manual/en/ref.session.php[+Session+] is persistent storage for transferring information from one page to another without using an link:wish-list-lesson5.html#_html_form_for_logon_on_index_php[+HTML input form+]. This functionality is supported through the predefined PHP array  `$_SESSION` .
 
-For the sake of security, after a new wisher is created he should be logged on automatically without filling in a form. Therefore you need to modify the  ``createNewWisher.php``  file to implement the following functionality:
+For the sake of security, after a new wisher is created he should be logged on automatically without filling in a form. Therefore you need to modify the  `createNewWisher.php`  file to implement the following functionality:
 
 * Add a new wisher to the database.
 * Open a session.
 * Store the wisher's name in the session.
-* Transfer the wisher's name in the session when the wisher is redirected to the  ``editWishList.php``  page.
+* Transfer the wisher's name in the session when the wisher is redirected to the  `editWishList.php`  page.
 
-In the  ``createNewWisher.php``  file, locate the line:
+In the  `createNewWisher.php`  file, locate the line:
 
 
-[source,java]
+[source,php]
 ----
 
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+WishDB::getInstance()->create_wisher($_POST['user'], $_POST['password']);
 ----
 
 and enter the following code block right below:
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
 $_SESSION['user'] = $_POST['user'];
 ----
 
-The code block starts a session, which means opening the  ``$_SESSION``  array for entering or retrieving data. Then the code adds an element to the  ``$_SESSION``  array. The added element contains a value and an identifier (key). The value is the name of the newly created wishers and the identifier is "user". Then the program redirects the wisher to the  ``editWishList.php``  page.
-
+The code block starts a session, which means opening the  `$_SESSION`  array for entering or retrieving data. Then the code adds an element to the  `$_SESSION`  array. The added element contains a value and an identifier (key). The value is the name of the newly created wishers and the identifier is "user". Then the program redirects the wisher to the  `editWishList.php`  page.
 
+[[_validating_user_logon]]
 == Validating User Logon
 
-When a user reaches the  ``editWishList.php``  page the application should confirm that the page is accessed by the same person who was just registered on the  ``createNewWisher.php``  page.
+When a user reaches the  `editWishList.php`  page the application should confirm that the page is accessed by the same person who was just registered on the  `createNewWisher.php`  page.
 
 Implementing this functionality consists of two steps:
 
-* <<retrievingUserNameFromSession,Retrieving the wisher's name from the Session>>
-* <<redirectingNotLoggedInUserToIndexPage,Redirecting the user to the index.php if retrieving the wisher's name from the Session failed>>
-
+* <<_retrieving_the_wisher_s_name_from_the_session,Retrieving the wisher's name from the Session>>
+* <<_logging_in_from_the_index_php_page,Redirecting the user to the index.php if retrieving the wisher's name from the Session failed>>
 
+[[_retrieving_the_wisher_s_name_from_the_session]]
 === Retrieving the Wisher's Name from the Session
 
-Replace the default code in the PHP block of  ``editWishList.php``  with the following:
+Replace the default code in the PHP block of  `editWishList.php`  with the following:
 
-[source,java]
+[source,php]
 ----
 
 session_start();
@@ -154,21 +120,21 @@ if (array_key_exists("user", $_SESSION)) {
 }
 ----
 
-The code block opens the  ``$_SESSION``  array for retrieving data and verifies that  ``$_SESSION``  contains an element with the identifier "user". If the check is successful, the code prints a welcome message.
+The code block opens the  `$_SESSION`  array for retrieving data and verifies that  `$_SESSION`  contains an element with the identifier "user". If the check is successful, the code prints a welcome message.
 
 To check that the session is implemented correctly:
 
-1. Run the  ``createNewWisher.php``  file and create a new wisher, for example Jack.
-The  ``editWishList.php``  opens with Hello Jack.
-2. Clear session cookies in your browser or end the session and run  ``editWishList.php``  from the IDE.
-The  ``editWishList.php``  file opens with Hello because no user has been transferred through a session. This is not correct because it enables someone who is not logged in and not registered to create or edit a wish list. In order to avoid this, the user needs to be redirected to the  ``index.php``  page.
-
+1. Run the  `createNewWisher.php`  file and create a new wisher, for example Jack.
+The  `editWishList.php`  opens with Hello Jack.
+2. Clear session cookies in your browser or end the session and run  `editWishList.php`  from the IDE.
+The  `editWishList.php`  file opens with Hello because no user has been transferred through a session. This is not correct because it enables someone who is not logged in and not registered to create or edit a wish list. In order to avoid this, the user needs to be redirected to the  `index.php`  page.
 
+[[_logging_in_from_the_index_php_page]]
 === Redirecting a User Who Is Not Logged In
 
-Add the following code block to  ``editWishList.php`` , below the  ``if``  clause:
+Add the following code block to  `editWishList.php` , below the  `if`  clause:
 
-[source,java]
+[source,php]
 ----
 
 else {
@@ -179,47 +145,47 @@ else {
 
 The code redirects the user to the index.php page and cancels PHP code execution.
 
-To check that the functionality is implemented correctly, run the  ``editWishList.php``  file. The expected result is that the  ``index.php``  page opens.
-
+To check that the functionality is implemented correctly, run the  `editWishList.php`  file. The expected result is that the  `index.php`  page opens.
 
+[[_html_form_for_logon_on_index_php]]
 == Logging In from the index.php Page
 
 The logon from the index.php page consists of two steps:
 
-* <<logonForm,Entering the user's name and password in an HTML input form and submitting the data for validation to the index.php page.>>
-* <<logonValidation,Validating the logon>>
-
+* <<_html_form_for_logon_on_index_php,Entering the user's name and password in an HTML input form and submitting the data for validation to the index.php page.>>
+* <<_logon_validation,Validating the logon>>
 
+[[_html_form_for_logon_on_index_php]]
 === HTML Form for Logon on index.php
 
-In the  ``index.php``  file, enter the following code before the closing  ``</body>``  tag:
+In the  `index.php`  file, enter the following code before the closing  `</body>`  tag:
 
 [source,xml]
 ----
 
 <form name="logon" action="index.php" method="POST" >
-    Username: <input type="text" name="user">
-    Password  <input type="password" name="userpassword">
-    <input type="submit" value="Edit My Wish List">
+  Username: <input type="text" name="user">
+  Password  <input type="password" name="userpassword">
+  <input type="submit" value="Edit My Wish List">
 </form>
 ----
 
-*Note: *You can ignore warnings from the HTML validator.
+*Note:* You can ignore warnings from the HTML validator.
 
 The code presents an link:wish-list-lesson3.html#htmlForm[+HTML form+] that enables entering the name and password of the user in the text fields. When the user clicks Edit My Wish List, the data is transferred to the same page, index.php.
 
-
+[[_logon_validation]]
 === Logon Validation
 
 Logon validation involves:
 
-* <<checkWhereUserCameFrom,Checking where the user was redirected from>>.
-* <<verifyCredentials,Verifying the user's name and password>>.
-* Saving the user name to the Session and redirecting the user to the editWishList.php page or <<displayErrorMessage,Displaying an error message.>>
+* <<_logon_validation,Checking where the user was redirected from>>.
+* <<_logon_validation,Verifying the user's name and password>>.
+* Saving the user name to the Session and redirecting the user to the editWishList.php page or <<_logon_validation,Displaying an error message.>>
 
-A user may access the  ``index.php``  page on starting the application, or from the<<validateWisherLogon, editWishList.php>> page, or when redirected from the  ``index.php``  page after entering name and password.
+A user may access the  `index.php`  page on starting the application, or from the <<_function_verify_wisher_credentials, editWishList.php>> page, or when redirected from the  `index.php`  page after entering name and password.
 
-Because only in the last case is the link:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+HTML request method+] POST used, you can always learn where the user was located when they accessed  ``index.php`` .
+Because only in the last case is the link:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+HTML request method+] POST used, you can always learn where the user was located when they accessed  `index.php` .
 
 In the index.php file, create a <?php ?> block above the HTML block, with the following code:
 
@@ -227,107 +193,115 @@ In the index.php file, create a <?php ?> block above the HTML block, with the fo
 ----
 
 <?php
-
 require_once("Includes/db.php");
-$logonSuccess = false;// verify user's credentials
+$logonSuccess = false;
+
+// verify user's credentials
 if ($_SERVER['REQUEST_METHOD'] == "POST") {
     $logonSuccess = (WishDB::getInstance()->verify_wisher_credentials($_POST['user'], $_POST['userpassword']));
     if ($logonSuccess == true) {
-        session_start();
-        $_SESSION['user'] = $_POST['user'];
-        header('Location: editWishList.php');
-        exit;
+      session_start();
+      $_SESSION['user'] = $_POST['user'];
+      header('Location: editWishList.php');
+      exit;
     }
 }
 ?>
-
 ----
 
-The top of the code block enables the use of the  ``db.php``  file and initializes the  ``$logonSuccess``  variable with the value  ``false`` . If validation succeeds, this value will change to  ``true`` .
-
-The code that verifies the user's credentials first checks if the request method is POST. If the request method is POST, the user was redirected after submitting the <<logonForm,logon form>>. In this case, the code block calls the  ``verify_wisher_credentials``  function with the name and password entered in the logon form.
+The top of the code block enables the use of the  `db.php`  file and initializes the  `$logonSuccess`  variable with the value  `false` . If validation succeeds, this value will change to  `true` .
 
-The  ``verify_wisher_credentials``  function, which you write in <<verifyWisherCredentials,the next section>>, checks whether there is a record in the  ``wishers``  table where the user and password match the values submitted in the <<logonForm,logon form>>. If the  ``verify_wisher_credentials``  function returns  ``true`` , a wisher with the specified combination of name and password is registered in the database. This means that validation succeeds, and  ``$logonSuccess``  changes valu [...]
+The code that verifies the user's credentials first checks if the request method is POST. If the request method is POST, the user was redirected after submitting the <<_html_form_for_logon_on_index_php,logon form>>. In this case, the code block calls the  `verify_wisher_credentials`  function with the name and password entered in the logon form.
 
-If the  ``verify_wisher_credentials``  function returns  ``false`` , the value of the  ``$logonSuccess``  variable remains false. The value of the variable is used in <<displayErrorMessage,displaying an error message>>.
+The  `verify_wisher_credentials`  function, which you write in <<_function_verify_wisher_credentials,the next section>>, checks whether there is a record in the  `wishers`  table where the user and password match the values submitted in the <<_html_form_for_logon_on_index_php,logon form>>. If the  `verify_wisher_credentials`  function returns  `true` , a wisher with the specified combination of name and password is registered in the database. This means that validation succeeds, and  `$l [...]
 
+If the  `verify_wisher_credentials`  function returns  `false` , the value of the  `$logonSuccess`  variable remains false. The value of the variable is used in <<_displaying_error_messages,displaying an error message>>.
 
+[[_function_verify_wisher_credentials]]
 === Function verify_wisher_credentials
 
-In order to implement verification of the wisher's credentials, you need to add a new function to the  ``WishDB``  class in the  ``db.php``  file. The function requires a name and a password as the input parameters and returns 0 or 1.
+In order to implement verification of the wisher's credentials, you need to add a new function to the  `WishDB`  class in the  `db.php`  file. The function requires a name and a password as the input parameters and returns 0 or 1.
 
 *For the MySQL database*, enter the following code block:
 
-[source,java]
+[source,php]
 ----
 
-public function verify_wisher_credentials ($name, $password){$name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$result = $this->query("SELECT 1 FROM wishers
- 	           WHERE name = '" . $name . "' AND password = '" . $password . "'");
-   return $result->data_seek(0);
+public function verify_wisher_credentials($name, $password) {
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+  $result = $this->query("SELECT 1 FROM wishers WHERE name = '"
+                  . $name . "' AND password = '" . $password . "'");
+  return $result->data_seek(0);
 }
 ----
 
-*For the Oracle Database*, enter the following code block (Because OCI8 has no equivalent to  ``mysql_num_rows`` , this code is a modified form of  ``get_wisher_id_by_name`` ):
+*For the Oracle Database*, enter the following code block (Because OCI8 has no equivalent to  `mysql_num_rows` , this code is a modified form of  `get_wisher_id_by_name` ):
 
 
-[source,java]
+[source,php]
 ----
 
 public function verify_wisher_credentials($name, $password) {
-    $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':name_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+  $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
+  $stid = oci_parse($this->con, $query);
+  oci_bind_by_name($stid, ':name_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
 //Because name is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);
-    if ($row) 
-        return true;
-    else
-        return false;
+  $row = oci_fetch_array($stid, OCI_ASSOC);
+  if ($row)
+    return true;
+  else
+    return false;
 }
 ----
 
-The code block executes the query  `` "SELECT 1 FROM wishers WHERE Name = '" . $name . "' AND Password = '" . $password . "'"``  and returns the number of records that meet the specified query. If such record is found, the function returns  ``true`` . If there is no such record in the database, the function returns  ``false`` .
-
+The code block executes the query  ` "SELECT 1 FROM wishers WHERE Name = '" . $name . "' AND Password = '" . $password . "'"`  and returns the number of records that meet the specified query. If such record is found, the function returns  `true` . If there is no such record in the database, the function returns  `false` .
 
+[[_displaying_error_messages]]
 === Displaying Error Messages
 
-In order to enable the application to display error messages, enter the following <? php ?> code block into the logon form in  ``index.php`` , below the input fields but above the button:
+In order to enable the application to display error messages, enter the following <? php ?> code block into the logon form in  `index.php` , below the input fields but above the button:
 
 [source,php]
 ----
 
 <?php
-  if ($_SERVER["REQUEST_METHOD"] == "POST") { 
-      if (!$logonSuccess)
-          echo "Invalid name and/or password";
-  }
+if ($_SERVER['REQUEST_METHOD'] == "POST") {
+  if (!$logonSuccess)
+    echo "Invalid name and/or password";
+}
 ?>
 ----
-The code block checks the value of the $logonSuccess variable and if it is false, displays an error message.
 
+The code block checks the value of the $logonSuccess variable and if it is false, displays an error message.
 
+[[_testing_the_logon_from_the_index_php_page]]
 == Testing the Logon from the index.php Page
 
-To check that the logon functionality works correctly on the  ``index.php``  front page:
+To check that the logon functionality works correctly on the  `index.php`  front page:
 
 1. Run the application.
-2. On the  ``index.php``  page, enter Tom in the Username edit box and Tim in the Password edit box.
+2. On the  `index.php`  page, enter Tom in the Username edit box and Tim in the Password edit box.
 3. Press Edit My Wish List. An error message is displayed (Note that browser window below is reduced to 600px width, which adds some line breaks): 
+
 image::images/incorrectNamePasswordIndex.png[]
+
 4. Enter Tom in the Username edit box and tomcat in the Password edit box.
 5. Press Edit My Wish list. The editWishList.php page is displayed: 
-image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+[[application_source_code_after_the_current_lesson_is_completed]]
 == Application Source Code after the Current Lesson Is Completed
 
-MySQL users: Click link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+ here+] to download the source code that reflects the project state after the lesson is completed.
-
-Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+ here+] to download the source code that reflects the project state after the lesson is completed.
+MySQL users: Click link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+here+] to download the source code that reflects the project state after the lesson is completed.
 
+Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+here+] to download the source code that reflects the project state after the lesson is completed.
 
+[[_next_steps]]
 == Next Steps
 
 link:wish-list-lesson4.html[+<< Previous lesson+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_ja.asciidoc
index 0742c0d..2cdf66b 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_ja.asciidoc
@@ -42,153 +42,133 @@
 :keywords: Apache NetBeans, Tutorials, レッスン5: セキュリティの追加。アプリケーション・ユーザー・ログオンの実装
 
 
-
-1. link:wish-list-tutorial-main-page.html[+PHPを使用するデータベース駆動型アプリケーションの作成 - メイン・ページ+]
-2. 
-データベースの作成
-
-1. link:wish-list-lesson1.html[+MySQLデータベースの作成+]
-2. link:wish-list-oracle-lesson1.html[+Oracleデータベース表の作成+]
-3. link:wish-list-lesson2.html[+アプリケーションの設計。データベースからの読取り+]
-4. link:wish-list-lesson3.html[+新規アプリケーション・ユーザーの作成+]
-5. link:wish-list-lesson4.html[+コードの最適化+]
-6. 
-*=> セキュリティの追加。アプリケーション・ユーザー・ログオンの実装*
-
-7. link:wish-list-lesson6.html[+データベースへの新しいウィッシュの追加+]
-8. link:wish-list-lesson7.html[+データベース内のエントリの更新および削除+]
-9. link:wish-list-lesson8.html[+CSSテクノロジを使用したアプリケーションの外観の改良+]
-10. link:wish-list-lesson9.html[+リモートWebサーバーへのアプリケーションのデプロイ+]
-
-image::images/netbeans-stamp-80-74-73.png[title="このページの内容は、NetBeans IDE 7.2、7.3、7.4および8.0に適用されます"]
-
 このレッスンでは、ウィッシャ用のログオン機能を実装します。これは次のファイルに影響します。
 
-*  ``index.php`` 
-*  ``createNewWisher.php`` 
-*  ``editWishlist.php`` 
-*  ``db.php`` 
+*  `index.php` 
+*  `createNewWisher.php` 
+*  `editWishlist.php` 
+*  `db.php` 
 
 ログオン機能の実装は、次の手順で構成されています。
 
-1. <<savingWisherIDInSessionUponCreation,ウィッシャの作成時に、セッションにウィッシャのIDを保存する>>
-2. <<validateWisherLogon,ウィッシュ・リストを編集しようとするユーザーがログインしていることを検証する>>
-3. <<logonFromIndexPage,index.phpページからウィッシャがログオンする>>
+1. <<_saving_the_wisher_s_id_in_the_session_upon_creation,ウィッシャの作成時に、セッションにウィッシャのIDを保存する>>
+2. <<_validating_user_logon,ウィッシュ・リストを編集しようとするユーザーがログインしていることを検証する>>
+3. <<_html_form_for_logon_on_index_php,index.phpページからウィッシャがログオンする>>
 
 現在のドキュメントは、PHP向けのNetBeans IDEでのCRUDアプリケーションの作成というPHPチュートリアルの一部です。
 
 
-
+[[_application_source_code_from_the_previous_lesson]]
 == 前のレッスンからのアプリケーション・ソース・コード
 
 MySQLユーザー: 前のレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/files/documents/4/1930/lesson4.zip[+ここ+]をクリックします。
 
 Oracleデータベース・ユーザー: 前のレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson4.zip[+ここ+]をクリックします。
 
-
+[[_saving_the_wisher_s_id_in_the_session_upon_creation]]
 == 作成時にセッションにウィッシャのIDを保存
 
-link:http://us2.php.net/manual/en/ref.session.php[+セッション+]は、link:wish-list-lesson5.html#htmlForm[+HTML入力フォーム+]を使用せずに、あるページから別のページへ情報を転送する持続的記憶域です。この機能は、事前定義されたPHP配列 ``$_SESSION`` によってサポートされています。
+link:http://us2.php.net/manual/en/ref.session.php[+セッション+]は、link:wish-list-lesson5.html#_html_form_for_logon_on_index_php[+HTML入力フォーム+]を使用せずに、あるページから別のページへ情報を転送する持続的記憶域です。この機能は、事前定義されたPHP配列 `$_SESSION` によってサポートされています。
 
-セキュリティのために、新しいウィッシャが作成されたら、フォームに入力せずに自動的にログオンする必要があります。そのため、 ``createNewWisher.php`` ファイルを変更して、次の機能を実装する必要があります。
+セキュリティのために、新しいウィッシャが作成されたら、フォームに入力せずに自動的にログオンする必要があります。そのため、 `createNewWisher.php` ファイルを変更して、次の機能を実装する必要があります。
 
 * データベースに新規ウィッシャを追加する。
 * セッションを開く。
 * ウィッシャの名前をセッションに保存する。
-* ウィッシャが ``editWishList.php`` ページにリダイレクトされたときに、セッションのウィッシャの名前を転送する。
+* ウィッシャが `editWishList.php` ページにリダイレクトされたときに、セッションのウィッシャの名前を転送する。
 
- ``createNewWisher.php`` ファイル内で、次の行を検索します。
+ `createNewWisher.php` ファイル内で、次の行を検索します。
 
 
-[source,java]
+[source,php]
 ----
 
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+WishDB::getInstance()->create_wisher($_POST['user'], $_POST['password']);
 ----
 
 そのすぐ下に、次のコード・ブロックを入力します。
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
 $_SESSION['user'] = $_POST['user'];
 ----
 
-このコード・ブロックはセッションを開始し、これは、データを入力または取得するための ``$_SESSION`` 配列を開くことを意味します。その後、コードは ``$_SESSION`` 配列に要素を追加します。追加された要素には、値と識別子(キー)が含まれています。値は、新しく作成されたウィッシャの名前で、識別子は「user」です。その後、プログラムはウィッシャを ``editWishList.php`` ページにリダイレクトします。
-
+このコード・ブロックはセッションを開始し、これは、データを入力または取得するための `$_SESSION` 配列を開くことを意味します。その後、コードは `$_SESSION` 配列に要素を追加します。追加された要素には、値と識別子(キー)が含まれています。値は、新しく作成されたウィッシャの名前で、識別子は「user」です。その後、プログラムはウィッシャを `editWishList.php` ページにリダイレクトします。
 
+[[_validating_user_logon]]
 == ユーザー・ログオンの検証
 
-ユーザーが ``editWishList.php`` ページに到達すると、アプリケーションは、 ``createNewWisher.php`` ページで登録されたのと同じユーザーがページにアクセスしていることを確認する必要があります。
+ユーザーが `editWishList.php` ページに到達すると、アプリケーションは、 `createNewWisher.php` ページで登録されたのと同じユーザーがページにアクセスしていることを確認する必要があります。
 
 この機能の実装は、次の2つのステップで構成されます。
 
-* <<retrievingUserNameFromSession,セッションからのウィッシャの名前の取得>>
-* <<redirectingNotLoggedInUserToIndexPage,セッションからのウィッシャの名前の取得に失敗した場合にユーザーをindex.phpにリダイレクトする>>
-
+* <<_retrieving_the_wisher_s_name_from_the_session,セッションからのウィッシャの名前の取得>>
+* <<_logging_in_from_the_index_php_page,セッションからのウィッシャの名前の取得に失敗した場合にユーザーをindex.phpにリダイレクトする>>
 
+[[_retrieving_the_wisher_s_name_from_the_session]]
 === セッションからのウィッシャの名前の取得
 
- ``editWishList.php`` のPHPブロックのデフォルト・コードを次に置き換えます。
+ `editWishList.php` のPHPブロックのデフォルト・コードを次に置き換えます。
 
-[source,java]
+[source,php]
 ----
 
 session_start();
 if (array_key_exists("user", $_SESSION)) {
-    echo "Hello " . $_SESSION['user'];
+  echo "Hello " . $_SESSION['user'];
 }
 ----
 
-このコード・ブロックは、データを取得するための ``$_SESSION`` 配列を開き、 ``$_SESSION`` に識別子「user」を持つ要素が含まれていることを確認します。確認が成功すると、コードは開始メッセージを出力します。
+このコード・ブロックは、データを取得するための `$_SESSION` 配列を開き、 `$_SESSION` に識別子「user」を持つ要素が含まれていることを確認します。確認が成功すると、コードは開始メッセージを出力します。
 
 セッションが正しく実装されていることを確認するには:
 
-1.  ``createNewWisher.php`` ファイルを実行し、Jackなどの新しいウィッシャを作成します。
- ``editWishList.php`` が開き、「Hello Jack」と表示されます。
-2. ブラウザのセッションCookieをクリアするか、またはセッションを終了して、IDEから ``editWishList.php`` を実行します。セッションを介して転送されたユーザーがいないため、
- ``editWishList.php`` ファイルが開き、「Hello」と表示されます。これは、未ログインおよび未登録のユーザーがウィッシュ・リストを作成したり編集できるようになるため、正しくありません。これを回避するには、ユーザーが ``index.php`` ページにリダイレクトされる必要があります。
-
+1.  `createNewWisher.php` ファイルを実行し、Jackなどの新しいウィッシャを作成します。
+ `editWishList.php` が開き、「Hello Jack」と表示されます。
+2. ブラウザのセッションCookieをクリアするか、またはセッションを終了して、IDEから `editWishList.php` を実行します。セッションを介して転送されたユーザーがいないため、
+ `editWishList.php` ファイルが開き、「Hello」と表示されます。これは、未ログインおよび未登録のユーザーがウィッシュ・リストを作成したり編集できるようになるため、正しくありません。これを回避するには、ユーザーが `index.php` ページにリダイレクトされる必要があります。
 
+[[_logging_in_from_the_index_php_page]]
 === ログインしていないユーザーのリダイレクト
 
-次のコード・ブロックを ``editWishList.php`` の ``if`` 節の下に追加します。
+次のコード・ブロックを `editWishList.php` の `if` 節の下に追加します。
 
-[source,java]
+[source,php]
 ----
 
 else {
-   header('Location: index.php');
-   exit;
+  header('Location: index.php');
+  exit;
 }
 ----
 
 このコードは、ユーザーをindex.phpページにリダイレクトし、PHPコードの実行を取り消します。
 
-機能が正しく実装されたことを確認するには、 ``editWishList.php`` ファイルを実行します。 ``index.php`` ページが開く場合は正常です。
-
+機能が正しく実装されたことを確認するには、 `editWishList.php` ファイルを実行します。 `index.php` ページが開く場合は正常です。
 
+[[_html_form_for_logon_on_index_php]]
 == index.phpページからのログイン
 
 index.phpページからのログオンは、次の2つのステップで構成されます。
 
-* <<logonForm,ユーザーの名前とパスワードをHTML入力フォームに入力し、検証のためにデータをindex.phpページに送信する>>
-* <<logonValidation,ログオンを検証する>>
-
+* <<_html_form_for_logon_on_index_php,ユーザーの名前とパスワードをHTML入力フォームに入力し、検証のためにデータをindex.phpページに送信する>>
+* <<_logon_validation,ログオンを検証する>>
 
+[[_html_form_for_logon_on_index_php]]
 === index.php上のログオン用のHTMLフォーム
 
- ``index.php`` ファイルで、次のコードを終了 ``</body>`` タグの前に入力します。
+ `index.php` ファイルで、次のコードを終了 `</body>` タグの前に入力します。
 
 [source,xml]
 ----
 
 <form name="logon" action="index.php" method="POST" >
-    Username: <input type="text" name="user">
-    Password  <input type="password" name="userpassword">
-    <input type="submit" value="Edit My Wish List">
+  Username: <input type="text" name="user">
+  Password  <input type="password" name="userpassword">
+  <input type="submit" value="Edit My Wish List">
 </form>
 ----
 
@@ -201,13 +181,13 @@ index.phpページからのログオンは、次の2つのステップで構成
 
 ログオンの検証には、次が含まれます。
 
-* <<checkWhereUserCameFrom,ユーザーのリダイレクト元を確認する>>。
-* <<verifyCredentials,ユーザーの名前とパスワードを確認する>>。
-* ユーザー名をセッションに保存して、ユーザーをeditWishList.phpページにリダイレクトするか、または<<displayErrorMessage,エラー・メッセージを表示する>>。
+* <<_logon_validation,ユーザーのリダイレクト元を確認する>>。
+* <<_logon_validation,ユーザーの名前とパスワードを確認する>>。
+* ユーザー名をセッションに保存して、ユーザーをeditWishList.phpページにリダイレクトするか、または<<_logon_validation,エラー・メッセージを表示する>>。
 
-ユーザーは、アプリケーションの開始時、 ``editWishList.php`` ページから、または名前とパスワードの入力後に<<validateWisherLogon,index.php>>ページからリダイレクトされたときに、 ``index.php`` ページにアクセスすることがあります。
+ユーザーは、アプリケーションの開始時、 `editWishList.php` ページから、または名前とパスワードの入力後に<<_function_verify_wisher_credentials,index.php>>ページからリダイレクトされたときに、 `index.php` ページにアクセスすることがあります。
 
-最後のケースのみlink:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+HTMLリクエスト・メソッド+]のPOSTが使用されるため、ユーザーが ``index.php`` にアクセスしたときに、そのユーザーがどこにいたのかを常に確認することができます。
+最後のケースのみlink:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+HTMLリクエスト・メソッド+]のPOSTが使用されるため、ユーザーが `index.php` にアクセスしたときに、そのユーザーがどこにいたのかを常に確認することができます。
 
 index.phpファイルで、次のコードを使用して、<?php?>ブロックをHTMLブロックの上に作成します。
 
@@ -215,107 +195,115 @@ index.phpファイルで、次のコードを使用して、<?php?>ブロック
 ----
 
 <?php
-
 require_once("Includes/db.php");
-$logonSuccess = false;// verify user's credentials
+$logonSuccess = false;
+
+// verify user's credentials
 if ($_SERVER['REQUEST_METHOD'] == "POST") {
     $logonSuccess = (WishDB::getInstance()->verify_wisher_credentials($_POST['user'], $_POST['userpassword']));
     if ($logonSuccess == true) {
-        session_start();
-        $_SESSION['user'] = $_POST['user'];
-        header('Location: editWishList.php');
-        exit;
+      session_start();
+      $_SESSION['user'] = $_POST['user'];
+      header('Location: editWishList.php');
+      exit;
     }
 }
 ?>
-
 ----
 
-コード・ブロックの先頭では、 ``db.php`` ファイルを使用可能にし、 ``$logonSuccess`` 変数を値 ``false`` で初期化します。検証に成功すると、この値は ``true`` に変更されます。
-
-ユーザーの資格を確認するコードは、最初に、リクエスト・メソッドがPOSTかどうかを確認します。リクエスト・メソッドがPOSTの場合、ユーザーは<<logonForm,ログオン・フォーム>>を送信した後にリダイレクトされます。この場合、コード・ブロックはログオン・フォームに入力された名前とパスワードを使用して ``verify_wisher_credentials`` 関数をコールします。
+コード・ブロックの先頭では、 `db.php` ファイルを使用可能にし、 `$logonSuccess` 変数を値 `false` で初期化します。検証に成功すると、この値は `true` に変更されます。
 
-<<verifyWisherCredentials,次の項>>で記述する ``verify_wisher_credentials`` 関数は、<<logonForm,ログオン・フォーム>>内で送信された値とユーザーおよびパスワードが一致するレコードが、 ``wishers`` 表にあるかどうかを確認します。 ``verify_wisher_credentials`` 関数が ``true`` を返す場合、指定された名前とパスワードの組合せを持つウィッシャがデータベースに登録されます。これは、検証が成功し、 ``$logonSuccess`` の値が ``true`` に変更されることを意味します。この場合、セッションが開始し、 ``$_SESSION`` 配列が開きます。コードは ``$_SESSION`` 配列に新しい要素を追加します。この要素には、値と識別子(キー)が含まれています。値はウィッシャの名前で、識別子は「user」です。次に、ウィッシュ・リストを編集するために、コードはユーザーを ``editWishList.php
 `` ページにリダイレクトします。
+ユーザーの資格を確認するコードは、最初に、リクエスト・メソッドがPOSTかどうかを確認します。リクエスト・メソッドがPOSTの場合、ユーザーは<<_html_form_for_logon_on_index_php,ログオン・フォーム>>を送信した後にリダイレクトされます。この場合、コード・ブロックはログオン・フォームに入力された名前とパスワードを使用して `verify_wisher_credentials` 関数をコールします。
 
- ``verify_wisher_credentials`` 関数が ``false`` を返す場合、 ``$logonSuccess`` 変数の値はfalseのままです。変数の値は、<<displayErrorMessage,エラー・メッセージの表示>>で使用されます。
+<<_function_verify_wisher_credentials,次の項>>で記述する `verify_wisher_credentials` 関数は、<<_html_form_for_logon_on_index_php,ログオン・フォーム>>内で送信された値とユーザーおよびパスワードが一致するレコードが、 `wishers` 表にあるかどうかを確認します。 `verify_wisher_credentials` 関数が `true` を返す場合、指定された名前とパスワードの組合せを持つウィッシャがデータベースに登録されます。これは、検証が成功し、 `$logonSuccess` の値が `true` に変更されることを意味します。この場合、セッションが開始し、 `$_SESSION` 配列が開きます。コードは `$_SESSION` 配列に新しい要素を追加します。この要素には、値と識別子(キー)が含まれています。値はウィッシャの名前で、識別子は「user」です。次に、ウィッシュ・リストを編集するために、コードはユーザー�
 � `editWishList.php [...]
 
+ `verify_wisher_credentials` 関数が `false` を返す場合、 `$logonSuccess` 変数の値はfalseのままです。変数の値は、<<_displaying_error_messages,エラー・メッセージの表示>>で使用されます。
 
+[[_function_verify_wisher_credentials]]
 === 関数verify_wisher_credentials
 
-ウィッシャの資格の確認を実装するには、 ``db.php`` ファイルの ``WishDB`` クラスに新しい関数を追加する必要があります。この関数は、入力パラメータとして名前とパスワードを必要とし、0または1を返します。
+ウィッシャの資格の確認を実装するには、 `db.php` ファイルの `WishDB` クラスに新しい関数を追加する必要があります。この関数は、入力パラメータとして名前とパスワードを必要とし、0または1を返します。
 
 *MySQLデータベースの場合*、次のコード・ブロックを入力します。
 
-[source,java]
+[source,php]
 ----
 
-public function verify_wisher_credentials ($name, $password){$name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$result = $this->query("SELECT 1 FROM wishers
- 	           WHERE name = '" . $name . "' AND password = '" . $password . "'");
-   return $result->data_seek(0);
+public function verify_wisher_credentials($name, $password) {
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+  $result = $this->query("SELECT 1 FROM wishers WHERE name = '"
+                  . $name . "' AND password = '" . $password . "'");
+  return $result->data_seek(0);
 }
 ----
 
-*Oracleデータベースの場合*、次のコード・ブロックを入力します(OCI8には ``mysql_num_rows`` と同等のものが存在しないため、このコードは ``get_wisher_id_by_name`` の変更された形式です)。
+*Oracleデータベースの場合*、次のコード・ブロックを入力します(OCI8には `mysql_num_rows` と同等のものが存在しないため、このコードは `get_wisher_id_by_name` の変更された形式です)。
 
 
-[source,java]
+[source,php]
 ----
 
 public function verify_wisher_credentials($name, $password) {
-    $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':name_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+  $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
+  $stid = oci_parse($this->con, $query);
+  oci_bind_by_name($stid, ':name_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
 //Because name is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);
-    if ($row) 
-        return true;
-    else
-        return false;
+  $row = oci_fetch_array($stid, OCI_ASSOC);
+  if ($row)
+    return true;
+  else
+    return false;
 }
 ----
 
-このコード・ブロックは、問合せ `` "SELECT 1 FROM wishers WHERE Name = '" . $name . "'AND Password = '" . $password . "'"`` を実行し、指定した問合せに一致するレコードの数を返します。そのようなレコードが見つかった場合、関数は ``true`` を返します。そのようなレコードがデータベースに存在しない場合、関数は ``false`` を返します。
-
+このコード・ブロックは、問合せ ` "SELECT 1 FROM wishers WHERE Name = '" . $name . "'AND Password = '" . $password . "'"` を実行し、指定した問合せに一致するレコードの数を返します。そのようなレコードが見つかった場合、関数は `true` を返します。そのようなレコードがデータベースに存在しない場合、関数は `false` を返します。
 
+[[_displaying_error_messages]]
 === エラー・メッセージの表示
 
-アプリケーションがエラー・メッセージを表示できるようにするには、次の<? >コード・ブロックを、 ``index.php`` のログオン・フォームの入力フィールドより下で、ボタンより上に入力します。
+アプリケーションがエラー・メッセージを表示できるようにするには、次の<? >コード・ブロックを、 `index.php` のログオン・フォームの入力フィールドより下で、ボタンより上に入力します。
 
 [source,php]
 ----
 
 <?php
-  if ($_SERVER["REQUEST_METHOD"] == "POST") { 
-      if (!$logonSuccess)
-          echo "Invalid name and/or password";
-  }
+if ($_SERVER['REQUEST_METHOD'] == "POST") {
+  if (!$logonSuccess)
+    echo "Invalid name and/or password";
+}
 ?>
 ----
-このコード・ブロックは$logonSuccess変数の値を確認し、falseの場合はエラー・メッセージを表示します。
 
+このコード・ブロックは$logonSuccess変数の値を確認し、falseの場合はエラー・メッセージを表示します。
 
+[[_testing_the_logon_from_the_index_php_page]]
 == index.phpページからのログオンのテスト
 
- ``index.php`` の最初のページでログオン機能が正しく動作することを確認するには:
+ `index.php` の最初のページでログオン機能が正しく動作することを確認するには:
 
 1. アプリケーションを実行します。
-2.  ``index.php`` ページで、「Username」編集ボックスに「Tom」と入力し、「Password」編集ボックスに「Tim」と入力します。
+2.  `index.php` ページで、「Username」編集ボックスに「Tom」と入力し、「Password」編集ボックスに「Tim」と入力します。
 3. 「Edit My Wish List」をクリックします。エラー・メッセージが表示されます(下のブラウザ・ウィンドウは幅が600pxに縮小されているため、改行がいくつか追加されています)。
+
 image::images/incorrectNamePasswordIndex.png[]
+
 4. 「Username」編集ボックスに「Tom」と入力し、「Password」編集ボックスに「tomcat」と入力します。
 5. 「Edit My Wish List」をクリックします。editWishList.phpページが表示されます。
-image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+[[application_source_code_after_the_current_lesson_is_completed]]
 == 現在のレッスン完了後のアプリケーション・ソース・コード
 
 MySQLユーザー: このレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+ここ+]をクリックします。
 
 Oracleデータベース・ユーザー: このレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+ここ+]をクリックします。
 
-
+[[_next_steps]]
 == 次の手順
 
 link:wish-list-lesson4.html[+<< 前のレッスン+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_pt_BR.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_pt_BR.asciidoc
index 94a053e..c3aa193 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_pt_BR.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_pt_BR.asciidoc
@@ -41,154 +41,131 @@
 :description: Lição 5: Adicionando Segurança. Implementando o Log-in do Usuário da Aplicação - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, Lição 5: Adicionando Segurança. Implementando o Log-in do Usuário da Aplicação
 
-
-
-1. link:wish-list-tutorial-main-page.html[+Criando uma Aplicação Orientada pelo Banco de Dados com o PHP - Página Principal+]
-2. 
-Criando o Banco de Dados
-
-1. link:wish-list-lesson1.html[+Criando um Banco de Dados MySQL+]
-2. link:wish-list-oracle-lesson1.html[+Criando Tabelas do Banco de Dados Oracle+]
-3. link:wish-list-lesson2.html[+Projetando a Aplicação. Lendo o Banco de Dados+]
-4. link:wish-list-lesson3.html[+Criando um Novo Usuário da Aplicação+]
-5. link:wish-list-lesson4.html[+Otimizando o Código+]
-6. 
-*=> Adicionando Segurança. Implementando o Log-in de Usuário a Aplicação*
-
-7. link:wish-list-lesson6.html[+Adicionando um Novo Desejo ao Banco de Dados+]
-8. link:wish-list-lesson7.html[+Atualizando e Deletando Entradas no Banco de Dados+]
-9. link:wish-list-lesson8.html[+Melhorando a Aparência da Aplicação Usando a Tecnologia CSS+]
-10. link:wish-list-lesson9.html[+Implantando a Aplicação em um Servidor Web Remoto+]
-
-image::images/netbeans-stamp-80-74-73.png[title="O conteúdo desta página se aplica ao NetBeans IDE 7.2, 7.3, 7.4 e 8.0"]
-
 Nesta lição, você implementará a funcionalidade de log-in para um wisher. Isso afeta os seguintes arquivos:
 
-*  ``index.php`` 
-*  ``createnewwisher.php`` 
-*  ``editWishlist.php`` 
-*  ``db.php`` 
+*  `index.php` 
+*  `createnewwisher.php` 
+*  `editWishlist.php` 
+*  `db.php` 
 
 Implementar a funcionalidade de log-in consiste nas seguintes etapas:
 
-1. <<savingWisherIDInSessionUponCreation,Salvar o wisher ID na Sessão em criação de um wisher>>
-2. <<validateWisherLogon,Validar se o usuário que tenta editar um desejo está conectado>>
-3. <<logonFromIndexPage,Fazer log-in do wisher na página index.php>>
+1. <<_saving_the_wisher_s_id_in_the_session_upon_creation,Salvar o wisher ID na Sessão em criação de um wisher>>
+2. <<_validating_user_logon,Validar se o usuário que tenta editar um desejo está conectado>>
+3. <<_html_form_for_logon_on_index_php,Fazer log-in do wisher na página index.php>>
 
 O documento atual é uma parte do tutorial Criando uma Aplicação CRUD no NetBeans IDE para PHP.
 
-
-
+[[_application_source_code_from_the_previous_lesson]]
 == Código-fonte da Aplicação da Lição Anterior
 
 Usuários MySQL: clique link:https://netbeans.org/files/documents/4/1930/lesson4.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição anterior estiver concluída.
 
 Usuários do banco de dados Oracle: clique link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson4.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição anterior for concluída.
 
-
+[[_saving_the_wisher_s_id_in_the_session_upon_creation]]
 == Salvando o wisher ID na Sessão Em Criação
 
-Uma link:http://us2.php.net/manual/en/ref.session.php[+Sessão+] é um armazenamento duradouro para transferir informações de uma página para outra sem usar um link:wish-list-lesson5.html#htmlForm[+form de entrada HTML+]. Essa funcionalidade tem suporte por meio de um array PHP predefinido  ``$_SESSION`` .
+Uma link:http://us2.php.net/manual/en/ref.session.php[+Sessão+] é um armazenamento duradouro para transferir informações de uma página para outra sem usar um link:wish-list-lesson5.html#htmlForm[+form de entrada HTML+]. Essa funcionalidade tem suporte por meio de um array PHP predefinido  `$_SESSION` .
 
-Por motivos de segurança, depois que um novo wisher é criado, ele deve se conectar automaticamente sem preencher um form. Portanto, você precisa modificar o arquivo  ``createNewWisher.php``  para implementar a seguinte funcionalidade:
+Por motivos de segurança, depois que um novo wisher é criado, ele deve se conectar automaticamente sem preencher um form. Portanto, você precisa modificar o arquivo  `createNewWisher.php`  para implementar a seguinte funcionalidade:
 
 * Adicione um novo wisher ao banco de dados.
 * Abra uma sessão.
 * Armazene o nome do wisher na sessão.
-* Transfira o nome do wisher na sessão quando ele for redirecionado para a página  ``editWishList.php`` .
+* Transfira o nome do wisher na sessão quando ele for redirecionado para a página  `editWishList.php` .
 
-No arquivo  ``createNewWisher.php`` , localize a linha:
+No arquivo  `createNewWisher.php` , localize a linha:
 
 
-[source,java]
+[source,php]
 ----
 
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+WishDB::getInstance()->create_wisher($_POST['user'], $_POST['password']);
 ----
 
 e insira o seguinte bloco de código abaixo:
 
-
-[source,java]
+[source,php]
 ----
 
 session_start();
 $_SESSION['user'] = $_POST['user'];
 ----
 
-O bloco de código inicia uma sessão, o que significa abrir o array  ``$_SESSION``  para inserir ou recuperar dados. Em seguida, o código adiciona um elemento ao array  ``$_SESSION`` . O elemento adicionado contém um valor e um identificador (chave). O valor é o nome dos wishers recém-criados e o identificador é "user". Em seguida, o programa redireciona o wisher para a página  ``editWishList.php`` .
-
+O bloco de código inicia uma sessão, o que significa abrir o array  `$_SESSION`  para inserir ou recuperar dados. Em seguida, o código adiciona um elemento ao array  `$_SESSION` . O elemento adicionado contém um valor e um identificador (chave). O valor é o nome dos wishers recém-criados e o identificador é "user". Em seguida, o programa redireciona o wisher para a página  `editWishList.php` .
 
+[[_validating_user_logon]]
 == Validando o Log-in do Usuário
 
-Quando um usuário chega à página  ``editWishList.php`` , a aplicação deve confirmar que a página foi acessada pela mesma pessoa que acabou de se registrar na página  ``createNewWisher.php`` .
+Quando um usuário chega à página  `editWishList.php` , a aplicação deve confirmar que a página foi acessada pela mesma pessoa que acabou de se registrar na página  `createNewWisher.php` .
 
 Implementar essa funcionalidade consiste em duas etapas:
 
-* <<retrievingUserNameFromSession,Recuperando o nome do wisher na Sessão>>
-* <<redirectingNotLoggedInUserToIndexPage,Redirecionar o usuário para o index.php, caso a recuperação do nome do wisher na sessão tenha falhado>>
-
+* <<_retrieving_the_wisher_s_name_from_the_session,Recuperando o nome do wisher na Sessão>>
+* <<_logging_in_from_the_index_php_page,Redirecionar o usuário para o index.php, caso a recuperação do nome do wisher na sessão tenha falhado>>
 
+[[_retrieving_the_wisher_s_name_from_the_session]]
 === Recuperando o Nome do Wisher da Sessão
 
-Substitua o código default no bloco PHP de  ``editWishList.php``  pelo seguinte:
+Substitua o código default no bloco PHP de  `editWishList.php`  pelo seguinte:
 
-[source,java]
+[source,php]
 ----
 
 session_start();
 if (array_key_exists("user", $_SESSION)) {
-    echo "Hello " . $_SESSION['user'];
+  echo "Hello " . $_SESSION['user'];
 }
 ----
 
-O bloco de código abre o array  ``$_SESSION``  para recuperar dados e verifica se  ``$_SESSION``  contém um elemento com o identificador "user". Se a verificação for bem-sucedida, o código imprime uma mensagem de boas-vindas.
+O bloco de código abre o array  `$_SESSION`  para recuperar dados e verifica se  `$_SESSION`  contém um elemento com o identificador "user". Se a verificação for bem-sucedida, o código imprime uma mensagem de boas-vindas.
 
 Para verificar se a sessão foi implementada corretamente:
 
-1. Execute o arquivo  ``createNewWisher.php``  e crie um novo wisher, por exemplo, Jack.
-O  ``editWishList.php``  abre com "Hello Jack" (Olá, Jack).
-2. Limpe os cookies da sessão em seu browser ou termine a sessão e execute  ``editWishList.php``  no IDE.
-O arquivo  ``editWishList.php``  abre com Hello porque nenhum usuário foi transferido a uma sessão. Isso não é correto, porque permite que alguém que não esteja conectado e não esteja registrado crie ou edite uma lista de desejos. Para evitar isso, o usuário precisa ser redirecionado para a página  ``index.php`` .
-
+1. Execute o arquivo  `createNewWisher.php`  e crie um novo wisher, por exemplo, Jack.
+O  `editWishList.php`  abre com "Hello Jack" (Olá, Jack).
+2. Limpe os cookies da sessão em seu browser ou termine a sessão e execute  `editWishList.php`  no IDE.
+O arquivo  `editWishList.php`  abre com Hello porque nenhum usuário foi transferido a uma sessão. Isso não é correto, porque permite que alguém que não esteja conectado e não esteja registrado crie ou edite uma lista de desejos. Para evitar isso, o usuário precisa ser redirecionado para a página  `index.php` .
 
+[[_logging_in_from_the_index_php_page]]
 === Redirecionando um Usuário Que Não Está Conectado
 
-Adicione o bloco de código seguinte ao  ``editWishList.php`` , abaixo da cláusula  ``if`` :
+Adicione o bloco de código seguinte ao  `editWishList.php` , abaixo da cláusula  `if` :
 
-[source,java]
+[source,php]
 ----
 
 else {
-   header('Location: index.php');
-   exit;
+  header('Location: index.php');
+  exit;
 }
 ----
 
 O código redireciona o usuário para a página index.php e cancela a execução do código PHP.
 
-Para verificar se a funcionalidade foi implementada corretamente, execute o arquivo  ``editWishList.php`` . O resultado esperado é que a página  ``index.php``  abra.
-
+Para verificar se a funcionalidade foi implementada corretamente, execute o arquivo  `editWishList.php` . O resultado esperado é que a página  `index.php`  abra.
 
+[[_html_form_for_logon_on_index_php]]
 == Fazendo log-in na página index.php
 
 O log-in na página index.php consiste em duas etapas:
 
-* <<logonForm,Indicando o nome e a senha do usuário em um form de entrada HTML e enviando os dados para validação à página index.php.>>
-* <<logonValidation,Validando o log-in>>
-
+* <<_html_form_for_logon_on_index_php,Indicando o nome e a senha do usuário em um form de entrada HTML e enviando os dados para validação à página index.php.>>
+* <<_logon_validation,Validando o log-in>>
 
+[[_html_form_for_logon_on_index_php]]
 === Form HTML para Log-in em index.php
 
-No arquivo  ``index.php`` , insira o código a seguir antes de fechar a tag  ``</body>`` :
+No arquivo  `index.php` , insira o código a seguir antes de fechar a tag  `</body>` :
 
 [source,xml]
 ----
 
 <form name="logon" action="index.php" method="POST" >
-    Username: <input type="text" name="user">
-    Password  <input type="password" name="userpassword">
-    <input type="submit" value="Edit My Wish List">
+  Username: <input type="text" name="user">
+  Password  <input type="password" name="userpassword">
+  <input type="submit" value="Edit My Wish List">
 </form>
 ----
 
@@ -196,18 +173,18 @@ No arquivo  ``index.php`` , insira o código a seguir antes de fechar a tag  ``<
 
 O código apresenta um link:wish-list-lesson3.html#htmlForm[+form HTML+] que permite inserir o nome e a senha do usuário nos campos de texto. Quando o usuário clica em Editar Minha Lista de Desejos, os dados são transferidos para a mesma página, index.php.
 
-
+[[_logon_validation]]
 === Validação de Log-in
 
 A validação do log-in envolve:
 
-* <<checkWhereUserCameFrom,Verificação de onde o usuário foi redirecionado>>.
-* <<verifyCredentials,Verificação do nome e senha do usuário>>.
-* Salvar o nome do usuário na Sessão e redirecionar o usuário para a página editWishList.php ou <<displayErrorMessage,Exibir uma mensagem de erro.>>
+* <<_logon_validation,Verificação de onde o usuário foi redirecionado>>.
+* <<_logon_validation,Verificação do nome e senha do usuário>>.
+* Salvar o nome do usuário na Sessão e redirecionar o usuário para a página editWishList.php ou <<_logon_validation,Exibir uma mensagem de erro.>>
 
-Um usuário pode acessar a página  ``index.php``  ao iniciar a aplicação, ou na página<<validateWisherLogon, editWishList.php>>, ou quando redirecionado da página  ``index.php``  depois de inserir o nome e a senha.
+Um usuário pode acessar a página  `index.php`  ao iniciar a aplicação, ou na página<<_function_verify_wisher_credentials, editWishList.php>>, ou quando redirecionado da página  `index.php`  depois de inserir o nome e a senha.
 
-Como o link:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+método de solicitação HTML+] POST é usado somente em último caso, você sempre pode saber onde o usuário estava localizado quando acessou o  ``index.php`` .
+Como o link:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+método de solicitação HTML+] POST é usado somente em último caso, você sempre pode saber onde o usuário estava localizado quando acessou o  `index.php` .
 
 No arquivo index.php, crie um bloco <?php ?> acima do bloco HTML, com o seguinte código:
 
@@ -215,107 +192,115 @@ No arquivo index.php, crie um bloco <?php ?> acima do bloco HTML, com o seguinte
 ----
 
 <?php
-
 require_once("Includes/db.php");
-$logonSuccess = false;// verify user's credentials
+$logonSuccess = false;
+
+// verify user's credentials
 if ($_SERVER['REQUEST_METHOD'] == "POST") {
     $logonSuccess = (WishDB::getInstance()->verify_wisher_credentials($_POST['user'], $_POST['userpassword']));
     if ($logonSuccess == true) {
-        session_start();
-        $_SESSION['user'] = $_POST['user'];
-        header('Location: editWishList.php');
-        exit;
+      session_start();
+      $_SESSION['user'] = $_POST['user'];
+      header('Location: editWishList.php');
+      exit;
     }
 }
 ?>
-
 ----
 
-O início do código permite que o usuário use o arquivo  ``db.php``  e inicialize a variável  ``$log-inSuccess``  com o valor  ``false`` . Se a validação ocorrer, esse valor mudará para  ``true`` .
-
-O código que verifica as credenciais do usuário verifica primeiro se o método de solicitação é POST. Se o método for POST, o usuário foi redirecionado depois de enviar o <<logonForm,form de log-in>>. Nesse caso, o bloco de código chama a função  ``verify_wisher_credentials``  com o nome e a senha inseridas no form de log-in.
+O início do código permite que o usuário use o arquivo  `db.php`  e inicialize a variável  `$log-inSuccess`  com o valor  `false` . Se a validação ocorrer, esse valor mudará para  `true` .
 
-A função  ``verify_wisher_credentials`` , que você escreverá <<verifyWisherCredentials,na próxima seção>>, verifica se há um registro na tabela de  ``wishers``  em que o usuário e a senha são confrontados com os valores enviados no <<logonForm,form de log-in>>. Se a função  ``verify_wisher_credentials``  retornar  ``true`` , um wisher com a combinação de nome e senha será registrado no banco de dados. Isso significa que a validação ocorreu e que  ``$log-inSuccess``  muda o valor para  `` [...]
+O código que verifica as credenciais do usuário verifica primeiro se o método de solicitação é POST. Se o método for POST, o usuário foi redirecionado depois de enviar o <<_html_form_for_logon_on_index_php,form de log-in>>. Nesse caso, o bloco de código chama a função  `verify_wisher_credentials`  com o nome e a senha inseridas no form de log-in.
 
-Se a função  ``verify_wisher_credentials``  retornar  ``false`` , o valor da variável  ``$log-inSuccess``  permanece falso. O valor da variável é usado em <<displayErrorMessage,exibindo uma mensagem de erro>>.
+A função  `verify_wisher_credentials` , que você escreverá <<_function_verify_wisher_credentials,na próxima seção>>, verifica se há um registro na tabela de  `wishers`  em que o usuário e a senha são confrontados com os valores enviados no <<verify_wisher_credentials,form de log-in>>. Se a função  `verify_wisher_credentials`  retornar  `true` , um wisher com a combinação de nome e senha será registrado no banco de dados. Isso significa que a validação ocorreu e que  `$log-inSuccess`  mud [...]
 
+Se a função  `verify_wisher_credentials`  retornar  `false` , o valor da variável  `$log-inSuccess`  permanece falso. O valor da variável é usado em <<_displaying_error_messages,exibindo uma mensagem de erro>>.
 
+[[_function_verify_wisher_credentials]]
 === Função verify_wisher_credentials
 
-Para implementar a verificação das credenciais do wisher, você precisa adicionar uma nova função à classe  ``WishDB``  no arquivo  ``db.php`` . A função requer um nome e uma senha como parâmetros de entrada e retorna 0 ou 1.
+Para implementar a verificação das credenciais do wisher, você precisa adicionar uma nova função à classe  `WishDB`  no arquivo  `db.php` . A função requer um nome e uma senha como parâmetros de entrada e retorna 0 ou 1.
 
 *Para o banco de dados MySQL*, insira o seguinte bloco de código:
 
-[source,java]
+[source,php]
 ----
 
-public function verify_wisher_credentials ($name, $password){$name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$result = $this->query("SELECT 1 FROM wishers
- 	           WHERE name = '" . $name . "' AND password = '" . $password . "'");
-   return $result->data_seek(0);
+public function verify_wisher_credentials($name, $password) {
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+  $result = $this->query("SELECT 1 FROM wishers WHERE name = '"
+                  . $name . "' AND password = '" . $password . "'");
+  return $result->data_seek(0);
 }
 ----
 
-*Para o banco de dados Oracle*, insira o seguinte bloco de código (como o OCI8 não tem equivalente para  ``mysql_num_rows`` , este código é uma forma modificada de  ``get_wisher_id_by_name`` ):
+*Para o banco de dados Oracle*, insira o seguinte bloco de código (como o OCI8 não tem equivalente para  `mysql_num_rows` , este código é uma forma modificada de  `get_wisher_id_by_name` ):
 
 
-[source,java]
+[source,php]
 ----
 
 public function verify_wisher_credentials($name, $password) {
-    $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':name_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+  $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
+  $stid = oci_parse($this->con, $query);
+  oci_bind_by_name($stid, ':name_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
 //Because name is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);
-    if ($row) 
-        return true;
-    else
-        return false;
+  $row = oci_fetch_array($stid, OCI_ASSOC);
+  if ($row)
+    return true;
+  else
+    return false;
 }
 ----
 
-O bloco de código executa a consulta  `` "SELECT 1 FROM wishers WHERE Name = '" . $name . "' AND Password = '". $password. "'"``  e retorna o número de registros que atendam à consulta especificada. Se o registro for encontrado, a função retorna  ``true`` . Se não houver registro no banco de dados, a função retornará  ``false`` .
-
+O bloco de código executa a consulta  ` "SELECT 1 FROM wishers WHERE Name = '" . $name . "' AND Password = '". $password. "'"`  e retorna o número de registros que atendam à consulta especificada. Se o registro for encontrado, a função retorna  `true` . Se não houver registro no banco de dados, a função retornará  `false` .
 
+[[_displaying_error_messages]]
 === Exibindo Mensagens de Erro
 
-Para permitir que a aplicação exiba mensagens de erro, insira o seguinte bloco de código <? php?> no form de log-in em  ``index.php`` , abaixo dos campos de entrada, mas acima do botão:
+Para permitir que a aplicação exiba mensagens de erro, insira o seguinte bloco de código <? php?> no form de log-in em  `index.php` , abaixo dos campos de entrada, mas acima do botão:
 
 [source,php]
 ----
 
 <?php
-  if ($_SERVER["REQUEST_METHOD"] == "POST") { 
-      if (!$logonSuccess)
-          echo "Invalid name and/or password";
-  }
+if ($_SERVER['REQUEST_METHOD'] == "POST") {
+  if (!$logonSuccess)
+    echo "Invalid name and/or password";
+}
 ?>
 ----
-O bloco de código verifica o valor da variável $log-inSuccess e se ele for falso, exibe uma mensagem de erro.
 
+O bloco de código verifica o valor da variável $log-inSuccess e se ele for falso, exibe uma mensagem de erro.
 
+[[_testing_the_logon_from_the_index_php_page]]
 == Testando o Log-in na Página index.php
 
-Para verificar se a funcionalidade de log-in funciona corretamente na página inicial  ``index.php`` :
+Para verificar se a funcionalidade de log-in funciona corretamente na página inicial  `index.php` :
 
 1. Execute a aplicação.
-2. Na página  ``index.php`` , digite Tom na caixa de edição Nome do Usuário e Tim na caixa de edição Senha.
+2. Na página  `index.php` , digite Tom na caixa de edição Nome do Usuário e Tim na caixa de edição Senha.
 3. Pressione Editar Minha Lista de Desejos. É exibida uma mensagem de erro (observe que a janela de browser abaixo é reduzida para 600 px de largura, o que acrescenta algumas quebras de linha): 
+
 image::images/incorrectNamePasswordIndex.png[]
+
 4. Digite Tom na caixa de edição Nome de Usuário e tomcat na caixa de edição Senha.
 5. Clique em Editar Minha Lista de Desejos. É exibida a página editWishList.php: 
-image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+[[application_source_code_after_the_current_lesson_is_completed]]
 == O código-fonte da Aplicação após a Lição Atual está Concluído
 
 Usuários MySQL: clique link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição estiver concluída.
 
 Usuários do banco de dados Oracle: clique link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição for concluída.
 
-
+[[_next_steps]]
 == Próximas Etapas
 
 link:wish-list-lesson4.html[+<< Lição anterior+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_ru.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_ru.asciidoc
index e6c7b90..1bf80fa 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_ru.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_ru.asciidoc
@@ -41,154 +41,132 @@
 :description: Урок 5: добавление функций безопасности Реализация входа пользователя в приложения - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, Урок 5: добавление функций безопасности Реализация входа пользователя в приложения
 
-
-
-1. link:wish-list-tutorial-main-page.html[+Создание приложения на основе базы данных с помощью языка PHP – главная страница+]
-2. 
-Создание базы данных
-
-1. link:wish-list-lesson1.html[+Создание базы данных MySQL+]
-2. link:wish-list-oracle-lesson1.html[+Создание таблиц базы данных Oracle+]
-3. link:wish-list-lesson2.html[+Проектирование приложения. Чтение из базы данных+]
-4. link:wish-list-lesson3.html[+Создание нового пользователя приложения+]
-5. link:wish-list-lesson4.html[+Усовершенствование кода+]
-6. 
-*=> Добавление функций безопасности. Реализация входа пользователя в приложение*
-
-7. link:wish-list-lesson6.html[+Добавление к базе данных новых желаний+]
-8. link:wish-list-lesson7.html[+Обновление и удаление записей в базе данных+]
-9. link:wish-list-lesson8.html[+Усовершенствование внешнего вида приложения с использованием технологии CSS+]
-10. link:wish-list-lesson9.html[+Развертывание приложения на удаленном веб-сервере+]
-
-image::images/netbeans-stamp-80-74-73.png[title="Содержимое этой страницы применимо к IDE NetBeans 7.2, 7.3, 7.4 и 8.0"]
-
 В этом уроке рассматривается реализация функциональных возможностей входа в приложение для пользователя. Эти функции применимы к следующим файлам:
 
-*  ``index.php`` 
-*  ``createNewWisher.php`` 
-*  ``editWishlist.php`` 
-*  ``db.php`` 
+*  `index.php` 
+*  `createNewWisher.php` 
+*  `editWishlist.php` 
+*  `db.php` 
 
 Реализация функции входа в систему состоит из следующих действий:
 
-1. <<savingWisherIDInSessionUponCreation,Сохранение идентификатора пользователя в сеансе после создания пользователя>>
-2. <<validateWisherLogon,Проверка того, что пользователь, предпринимающий попытки редактирования списка "Wish list", зарегистрирован в системе.>>
-3. <<logonFromIndexPage,Регистрация пользователя на странице index.php >>
+1. <<_saving_the_wisher_s_id_in_the_session_upon_creation,Сохранение идентификатора пользователя в сеансе после создания пользователя>>
+2. <<_validating_user_logon,Проверка того, что пользователь, предпринимающий попытки редактирования списка "Wish list", зарегистрирован в системе.>>
+3. <<_html_form_for_logon_on_index_php,Регистрация пользователя на странице index.php >>
 
 Текущий документ является частью краткого учебного курса "Создание приложения CRUD в IDE NetBeans для PHP".
 
-
-
+[[_application_source_code_from_the_previous_lesson]]
 == Исходный код приложения из предыдущего урока
 
 Для пользователей MySQL: перейдите по link:https://netbeans.org/files/documents/4/1930/lesson4.zip[+этой ссылке+] для загрузки исходного кода, описывающего состояние проекта на момент завершения предыдущего урока.
 
 Для пользователей баз данных Oracle: перейдите по link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson4.zip[+этой+] для загрузки исходного кода, описывающего состояние проекта на момент завершения предыдущего урока.
 
-
+[[_saving_the_wisher_s_id_in_the_session_upon_creation]]
 == Сохранение идентификатора пользователя в сеансе после создания пользователя
 
-link:http://us2.php.net/manual/en/ref.session.php[+Session+] ("Сеанс") является хранилищем состояния для передачи информации с одной страницы на другую без использования link:wish-list-lesson5.html#htmlForm[+формы ввода HTML+]. Данная функция поддерживается посредством предопределенного массива PHР  ``$_SESSION`` .
+link:http://us2.php.net/manual/en/ref.session.php[+Session+] ("Сеанс") является хранилищем состояния для передачи информации с одной страницы на другую без использования link:wish-list-lesson5.html#htmlForm[+формы ввода HTML+]. Данная функция поддерживается посредством предопределенного массива PHР  `$_SESSION` .
 
-В целях безопасности новый пользователь после создания должен быть автоматически зарегистрирован без заполнения формы. Поэтому необходимо изменить файл  ``createNewWisher.php``  для реализации следующих функциональных возможностей:
+В целях безопасности новый пользователь после создания должен быть автоматически зарегистрирован без заполнения формы. Поэтому необходимо изменить файл  `createNewWisher.php`  для реализации следующих функциональных возможностей:
 
 * Добавление нового пользователя в базу данных.
 * Открытие сеанса.
 * Сохранение имени пользователя в сеансе
-* Передача имени пользователя в сеансе при переадресации пользователя на страницу  ``editWishList.php`` .
+* Передача имени пользователя в сеансе при переадресации пользователя на страницу  `editWishList.php` .
 
-В файл  ``createNewWisher.php``  включите следующую строку:
+В файл  `createNewWisher.php`  включите следующую строку:
 
 
-[source,java]
+[source,php]
 ----
 
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+WishDB::getInstance()->create_wisher($_POST['user'], $_POST['password']);
 ----
 
 а далее введите следующий блок кода:
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
 $_SESSION['user'] = $_POST['user'];
 ----
 
-Блок кода начинает сеанс, что означает открытие массива  ``$_SESSION``  для ввода или извлечения данных. Затем код добавляет элемент к массиву  ``$_SESSION`` . Добавляемый элемент содержит значение и идентификатор. Значение – это имя недавно созданных пользователей, а "user" является идентификатором. Затем программа переадресует пользователя на страницу  ``editWishList.php`` .
-
+Блок кода начинает сеанс, что означает открытие массива  `$_SESSION`  для ввода или извлечения данных. Затем код добавляет элемент к массиву  `$_SESSION` . Добавляемый элемент содержит значение и идентификатор. Значение – это имя недавно созданных пользователей, а "user" является идентификатором. Затем программа переадресует пользователя на страницу  `editWishList.php` .
 
+[[_validating_user_logon]]
 == Проверка допустимости входа для пользователя
 
-При переходе пользователя на страницу  ``editWishList.php``  приложение должно выдавать подтверждение того, что страница используется лицом, только что зарегистрированным на странице  ``createNewWisher.php`` .
+При переходе пользователя на страницу  `editWishList.php`  приложение должно выдавать подтверждение того, что страница используется лицом, только что зарегистрированным на странице  `createNewWisher.php` .
 
 Реализация этих функциональных возможностей состоит из двух действий:
 
-* <<retrievingUserNameFromSession,Извлечение имени пользователя из сеанса>>
-* <<redirectingNotLoggedInUserToIndexPage,Переадресация пользователя на страницу index.php, в случае если имя пользователя не было извлечено из сеанса>>
-
+* <<_retrieving_the_wisher_s_name_from_the_session,Извлечение имени пользователя из сеанса>>
+* <<_logging_in_from_the_index_php_page,Переадресация пользователя на страницу index.php, в случае если имя пользователя не было извлечено из сеанса>>
 
+[[_retrieving_the_wisher_s_name_from_the_session]]
 === Извлечение имени пользователя из сеанса
 
-Замените код, содержащийся в блоке PHP по умолчанию,  ``editWishList.php``  следующим кодом:
+Замените код, содержащийся в блоке PHP по умолчанию,  `editWishList.php`  следующим кодом:
 
-[source,java]
+[source,php]
 ----
 
 session_start();
 if (array_key_exists("user", $_SESSION)) {
-    echo "Hello " . $_SESSION['user'];
+  echo "Hello " . $_SESSION['user'];
 }
 ----
 
-Блок кода открывает массив  ``$_SESSION``  для извлечения данных и проверки того, что в  ``$_SESSION``  содержится элемент с идентификатором "user". Если проверка выполнена успешно, код выводит на экран приветственное сообщение.
+Блок кода открывает массив  `$_SESSION`  для извлечения данных и проверки того, что в  `$_SESSION`  содержится элемент с идентификатором "user". Если проверка выполнена успешно, код выводит на экран приветственное сообщение.
 
 Для проверки правильности реализации сеанса выполните следующие действия:
 
-1. Запустите файл  ``createNewWisher.php``  и создайте нового пользователя, например, с именем "Jack".
-Откроется файл  ``editWishList.php``  с приветственным сообщением "Hello Jack".
-2. Можно либо очистить файл cookie сеанса в используемом браузере, либо завершить сеанс и запустить файл  ``editWishList.php``  в среде IDE.
-Откроется файл  ``editWishList.php`` , содержащий текст "Hello", поскольку в рамках сеанса не были переданы какие-либо данные пользователя. Это нежелательный вариант, так как в данном случае незарегистрированный или не выполнивший вход в систему пользователь может создавать или редактировать список "Wish list". Во избежание этого следует выполнить переадресацию пользователя на страницу  ``index.php`` .
-
+1. Запустите файл  `createNewWisher.php`  и создайте нового пользователя, например, с именем "Jack".
+Откроется файл  `editWishList.php`  с приветственным сообщением "Hello Jack".
+2. Можно либо очистить файл cookie сеанса в используемом браузере, либо завершить сеанс и запустить файл  `editWishList.php`  в среде IDE.
+Откроется файл  `editWishList.php` , содержащий текст "Hello", поскольку в рамках сеанса не были переданы какие-либо данные пользователя. Это нежелательный вариант, так как в данном случае незарегистрированный или не выполнивший вход в систему пользователь может создавать или редактировать список "Wish list". Во избежание этого следует выполнить переадресацию пользователя на страницу  `index.php` .
 
+[[_logging_in_from_the_index_php_page]]
 === Переадресация пользователя, не зарегистрированного в системе
 
-Разместите следующий блок кода в файле  ``editWishList.php``  под выражением  ``if`` :
+Разместите следующий блок кода в файле  `editWishList.php`  под выражением  `if` :
 
-[source,java]
+[source,php]
 ----
 
 else {
-   header('Location: index.php');
-   exit;
+  header('Location: index.php');
+  exit;
 }
 ----
 
 В соответствии с кодом осуществляется переадресация пользователя на страницу index.php и прерывается выполнение кода PHP.
 
-Для проверки того, что функциональные возможности реализованы правильно, запустите файл  ``editWishList.php`` . Ожидаемым результатом является открытие страницы  ``index.php`` .
-
+Для проверки того, что функциональные возможности реализованы правильно, запустите файл  `editWishList.php` . Ожидаемым результатом является открытие страницы  `index.php` .
 
+[[_html_form_for_logon_on_index_php]]
 == Регистрация на странице index.php
 
 Вход с использованием страницы index.php состоит из двух действий:
 
 * <<logonForm,Ввод имени пользователя и пароля в форму ввода HTML и передача данных на страницу index.php для проверки достоверности.>>
-* <<logonValidation,Проверка допустимости входа>>
-
+* <<_logon_validation,Проверка допустимости входа>>
 
+[[_html_form_for_logon_on_index_php]]
 === Форма HTML для входа на странице index.php
 
-В файле  ``index.php``  перед закрытием тега  ``</body>`` введите следующий код:
+В файле  `index.php`  перед закрытием тега  `</body>` введите следующий код:
 
 [source,xml]
 ----
 
 <form name="logon" action="index.php" method="POST" >
-    Username: <input type="text" name="user">
-    Password  <input type="password" name="userpassword">
-    <input type="submit" value="Edit My Wish List">
+  Username: <input type="text" name="user">
+  Password  <input type="password" name="userpassword">
+  <input type="submit" value="Edit My Wish List">
 </form>
 ----
 
@@ -196,18 +174,18 @@ else {
 
 Код представляет собой link:wish-list-lesson3.html#htmlForm[+форму HTML+] которая позволяет вводить имя и пароль пользователя в текстовые поля. Если пользователь нажимает кнопку "Edit My Wish List", данные передаются на ту же страницу – index.php.
 
-
+[[_logon_validation]]
 === Проверка допустимости входа
 
 Проверка допустимости входа включает следующие действия:
 
-* <<checkWhereUserCameFrom,Проверка местоположения пользователя до переадресации>>.
-* <<verifyCredentials,Проверка имени пользователя и пароля>>.
-* Сохранение имени пользователя в сеансе и переадресация пользователя на страницу editWishList.php или <<displayErrorMessage,Отображение сообщения об ошибке.>>
+* <<_logon_validation,Проверка местоположения пользователя до переадресации>>.
+* <<_logon_validation,Проверка имени пользователя и пароля>>.
+* Сохранение имени пользователя в сеансе и переадресация пользователя на страницу editWishList.php или <<_logon_validation,Отображение сообщения об ошибке.>>
 
-Пользователь может выполнить доступ на страницу  ``index.php``  при запуске приложения, с помощью страницы <<validateWisherLogon, editWishList.php>> или при переадресации со страницы  ``index.php``  после ввода имени и пароля.
+Пользователь может выполнить доступ на страницу  `index.php`  при запуске приложения, с помощью страницы <<_function_verify_wisher_credentials, editWishList.php>> или при переадресации со страницы  `index.php`  после ввода имени и пароля.
 
-Поскольку только в последнем случае используется link:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+метод запроса HTML+] POST, существует возможность узнать местонахождение пользователя, если он выполняет доступ к странице  ``index.php`` .
+Поскольку только в последнем случае используется link:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+метод запроса HTML+] POST, существует возможность узнать местонахождение пользователя, если он выполняет доступ к странице  `index.php` .
 
 В файле index.php над блоком HTML создайте блок <? php? > со следующим кодом:
 
@@ -215,107 +193,115 @@ else {
 ----
 
 <?php
-
 require_once("Includes/db.php");
-$logonSuccess = false;// verify user's credentials
+$logonSuccess = false;
+
+// verify user's credentials
 if ($_SERVER['REQUEST_METHOD'] == "POST") {
     $logonSuccess = (WishDB::getInstance()->verify_wisher_credentials($_POST['user'], $_POST['userpassword']));
     if ($logonSuccess == true) {
-        session_start();
-        $_SESSION['user'] = $_POST['user'];
-        header('Location: editWishList.php');
-        exit;
+      session_start();
+      $_SESSION['user'] = $_POST['user'];
+      header('Location: editWishList.php');
+      exit;
     }
 }
 ?>
-
 ----
 
-Верхняя часть этого блока кода разрешает использование файла  ``db.php``  и инициализирует переменную  ``$logonSuccess``  со значением  ``false`` . В случае успешной проверки это значение сменится на  ``true`` .
+Верхняя часть этого блока кода разрешает использование файла  `db.php`  и инициализирует переменную  `$logonSuccess`  со значением  `false` . В случае успешной проверки это значение сменится на  `true` .
 
-Код, проверяющий учетные данные пользователя, сперва проверяет, является ли методом запроса POST. Если POST является методом запроса, то пользователь был перенаправлен после подачи <<logonForm,формы входа>>. В таком случае блок кода вызывает функцию  ``verify_wisher_credentials`` , используя имя и пароль, введенные в форме входа.
+Код, проверяющий учетные данные пользователя, сперва проверяет, является ли методом запроса POST. Если POST является методом запроса, то пользователь был перенаправлен после подачи <<_html_form_for_logon_on_index_php,формы входа>>. В таком случае блок кода вызывает функцию  `verify_wisher_credentials` , используя имя и пароль, введенные в форме входа.
 
-Функция  ``verify_wisher_credentials`` , которую мы напишем в <<verifyWisherCredentials,следующем разделе>>, проверяет есть ли запись в таблице  ``пользователей`` , где имя пользователя и пароль совпадают со значениями, поданными в <<logonForm,форме входа>>. Если функция  ``verify_wisher_credentials``  возвращает  ``true`` , то в базе данных есть пользователь с указанной комбинацией имени и пароля. Это значит, что проверка успешна и значение  ``$logonSuccess``  меняется на  ``true`` . В  [...]
-
-Если функция  ``verify_wisher_credentials``  возвращает  ``false`` , то значением переменной  ``$logonSuccess``  останется false. Значение переменной используется для <<displayErrorMessage,отображения сообщения об ошибке>>.
+Функция  `verify_wisher_credentials` , которую мы напишем в <<_function_verify_wisher_credentials,следующем разделе>>, проверяет есть ли запись в таблице  `пользователей` , где имя пользователя и пароль совпадают со значениями, поданными в <<_html_form_for_logon_on_index_php,форме входа>>. Если функция  `verify_wisher_credentials`  возвращает  `true` , то в базе данных есть пользователь с указанной комбинацией имени и пароля. Это значит, что проверка успешна и значение  `$logonSuccess`   [...]
 
+Если функция  `verify_wisher_credentials`  возвращает  `false` , то значением переменной  `$logonSuccess`  останется false. Значение переменной используется для <<displayErrorMessage,отображения сообщения об ошибке>>.
 
+[[_function_verify_wisher_credentials]]
 === Функция verify_wisher_credentials
 
-Для проверки учетных данных пользователя необходимо добавить новую функцию к классу  ``WishDB``  в файле  ``db.php`` . Входными параметрами для этой функции являются имя и пароль; функция возвращает значение 0 или 1.
+Для проверки учетных данных пользователя необходимо добавить новую функцию к классу  `WishDB`  в файле  `db.php` . Входными параметрами для этой функции являются имя и пароль; функция возвращает значение 0 или 1.
 
 *Для базы данных MySQL* введите следующий блок кода:
 
-[source,java]
+[source,php]
 ----
 
-public function verify_wisher_credentials ($name, $password){$name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$result = $this->query("SELECT 1 FROM wishers
- 	           WHERE name = '" . $name . "' AND password = '" . $password . "'");
-   return $result->data_seek(0);
+public function verify_wisher_credentials($name, $password) {
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+  $result = $this->query("SELECT 1 FROM wishers WHERE name = '"
+                  . $name . "' AND password = '" . $password . "'");
+  return $result->data_seek(0);
 }
 ----
 
-*Для базы данных Oracle* введите следующий блок кода (поскольку в OCI8 нет эквивалента для  ``mysql_num_rows`` , данный код является модифицированной формой  ``get_wisher_id_by_name`` ):
+*Для базы данных Oracle* введите следующий блок кода (поскольку в OCI8 нет эквивалента для  `mysql_num_rows` , данный код является модифицированной формой  `get_wisher_id_by_name` ):
 
 
-[source,java]
+[source,php]
 ----
 
 public function verify_wisher_credentials($name, $password) {
-    $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':name_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+  $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
+  $stid = oci_parse($this->con, $query);
+  oci_bind_by_name($stid, ':name_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
 //Because name is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);
-    if ($row) 
-        return true;
-    else
-        return false;
+  $row = oci_fetch_array($stid, OCI_ASSOC);
+  if ($row)
+    return true;
+  else
+    return false;
 }
 ----
 
-Блок кода выполняет запрос  `` "SELECT 1 FROM wishers WHERE Name = '" . $name . "' AND Password = '" . $password . "'"``  и возвращает число записей, соответствующих указанному запросу. Если такая запись найдена, функция возвратит  ``true`` . Если такой записи в базе данных не найдено, функция возвратит  ``false`` .
-
+Блок кода выполняет запрос  ` "SELECT 1 FROM wishers WHERE Name = '" . $name . "' AND Password = '" . $password . "'"`  и возвращает число записей, соответствующих указанному запросу. Если такая запись найдена, функция возвратит  `true` . Если такой записи в базе данных не найдено, функция возвратит  `false` .
 
+[[_displaying_error_messages]]
 === Отображение сообщений об ошибках
 
-Для включения отображения сообщений об ошибках в приложении введите следующий блок кода <? php ? > в форму "logon" на странице  ``index.php``  после полей ввода, но над кнопкой:
+Для включения отображения сообщений об ошибках в приложении введите следующий блок кода <? php ? > в форму "logon" на странице  `index.php`  после полей ввода, но над кнопкой:
 
 [source,php]
 ----
 
 <?php
-  if ($_SERVER["REQUEST_METHOD"] == "POST") { 
-      if (!$logonSuccess)
-          echo "Invalid name and/or password";
-  }
+if ($_SERVER['REQUEST_METHOD'] == "POST") {
+  if (!$logonSuccess)
+    echo "Invalid name and/or password";
+}
 ?>
 ----
-Блок кода проверяет значение переменной $logonSuccess, и если значение есть "false", на экран выводится сообщение об ошибке.
 
+Блок кода проверяет значение переменной $logonSuccess, и если значение есть "false", на экран выводится сообщение об ошибке.
 
+[[_testing_the_logon_from_the_index_php_page]]
 == Тестирование входа с помощью страницы index.php
 
-Для проверки корректности работы функции входа на первой странице  ``index.php``  выполните следующие действия:
+Для проверки корректности работы функции входа на первой странице  `index.php`  выполните следующие действия:
 
 1. Запустите приложение.
-2. На странице  ``index.php``  введите "Tom" в поле "Username" и "Tim" в поле "Password".
+2. На странице  `index.php`  введите "Tom" в поле "Username" и "Tim" в поле "Password".
 3. Нажмите кнопку "Edit My Wish List". Отобразится сообщение об ошибке (обратите внимание, что ширина приведенного ниже окна браузера уменьшена до 600 пикселей, в результате чего добавляется несколько разрывов строк). 
+
 image::images/incorrectNamePasswordIndex.png[]
+
 4. Введите "Tom" в поле "Username" и "tomcat" в поле "Password".
 5. Нажмите кнопку Edit My Wish List ("Редактировать мой список желаний"). Отобразится страница editWishList.php: 
-image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+[[application_source_code_after_the_current_lesson_is_completed]]
 == Исходный код приложения на момент завершения текущего урока
 
 Для пользователей MySQL: щелкните link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+здесь+] для загрузки исходного кода, отражающего состояние проекта по завершении данного урока.
 
 Для пользователей Oracle Database: щелкните link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+здесь+] для загрузки исходного кода, отражающего состояние проекта по завершении данного урока.
 
-
+[[_next_steps]]
 == Что дальше?
 
 link:wish-list-lesson4.html[+<<Предыдущий урок+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_zh_CN.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_zh_CN.asciidoc
index ce78ed8..cfe2f8e 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_zh_CN.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson5_zh_CN.asciidoc
@@ -42,153 +42,132 @@
 :keywords: Apache NetBeans, Tutorials, 第 5 课:添加安全功能。实现应用程序用户登录
 
 
-
-1. link:wish-list-tutorial-main-page.html[+使用 PHP 创建数据库驱动的应用程序 - 主页+]
-2. 
-创建数据库
-
-1. link:wish-list-lesson1.html[+创建 MySQL 数据库+]
-2. link:wish-list-oracle-lesson1.html[+创建 Oracle 数据库表+]
-3. link:wish-list-lesson2.html[+设计应用程序。从数据库读取数据+]
-4. link:wish-list-lesson3.html[+创建新的应用程序用户+]
-5. link:wish-list-lesson4.html[+优化代码+]
-6. 
-*=> 添加安全功能。实现应用程序用户登录*
-
-7. link:wish-list-lesson6.html[+在数据库中添加新的愿望+]
-8. link:wish-list-lesson7.html[+更新和删除数据库中的条目+]
-9. link:wish-list-lesson8.html[+使用 CSS 技术改进应用程序的外观+]
-10. link:wish-list-lesson9.html[+将应用程序部署到远程 Web 服务器+]
-
-image::images/netbeans-stamp-80-74-73.png[title="此页上的内容适用于 NetBeans IDE 7.2、7.3、7.4 和 8.0"]
-
 在本课中,将为许愿者实现登录功能。这会影响以下文件:
 
-*  ``index.php`` 
-*  ``createNewWisher.php`` 
-*  ``editWishlist.php`` 
-*  ``db.php`` 
+*  `index.php` 
+*  `createNewWisher.php` 
+*  `editWishlist.php` 
+*  `db.php` 
 
 实现登录功能包括以下步骤:
 
-1. <<savingWisherIDInSessionUponCreation,在创建许愿者后,在会话中保存许愿者 ID>>
-2. <<validateWisherLogon,验证尝试编辑愿望列表的用户是否登录>>
-3. <<logonFromIndexPage,许愿者从 index.php 页中登录>>
+1. <<_saving_the_wisher_s_id_in_the_session_upon_creation,在创建许愿者后,在会话中保存许愿者 ID>>
+2. <<_validating_user_logon,验证尝试编辑愿望列表的用户是否登录>>
+3. <<_html_form_for_logon_on_index_php,许愿者从 index.php 页中登录>>
 
 当前文档是“在适用于 PHP 的 NetBeans IDE 中创建 CRUD 应用程序”教程的一部分。
 
-
-
+[[_application_source_code_from_the_previous_lesson]]
 == 来自上一课的应用程序源代码
 
 MySQL 用户:单击link:https://netbeans.org/files/documents/4/1930/lesson4.zip[+此处+]以下载源代码,该代码反映了在完成上一课之后的项目状态。
 
 Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson4.zip[+此处+]以下载源代码,该代码反映了在完成上一课之后的项目状态。
 
-
+[[_saving_the_wisher_s_id_in_the_session_upon_creation]]
 == 创建后在会话中保存许愿者 ID
 
-link:http://us2.php.net/manual/en/ref.session.php[+会话+]是持久性存储,可用于将信息从一个页面传输到另一个页面,而无需使用 link:wish-list-lesson5.html#htmlForm[+HTML 输入窗体+]。可通过预定义的 PHP 数组  ``$_SESSION``  支持该功能。
+link:http://us2.php.net/manual/en/ref.session.php[+会话+]是持久性存储,可用于将信息从一个页面传输到另一个页面,而无需使用 link:wish-list-lesson5.html#htmlForm[+HTML 输入窗体+]。可通过预定义的 PHP 数组  `$_SESSION`  支持该功能。
 
-为安全起见,在创建新的许愿者后,该许愿者将自动登录而无需填写窗体。因此,您需要修改  ``createNewWisher.php``  文件以实现以下功能:
+为安全起见,在创建新的许愿者后,该许愿者将自动登录而无需填写窗体。因此,您需要修改  `createNewWisher.php`  文件以实现以下功能:
 
 * 将新许愿者添加到数据库中。
 * 打开会话。
 * 在会话中存储许愿者的名字。
-* 在将许愿者重定向到  ``editWishList.php``  页时,传输会话中的许愿者名字。
+* 在将许愿者重定向到  `editWishList.php`  页时,传输会话中的许愿者名字。
 
-在  ``createNewWisher.php``  文件中,找到以下行:
+在  `createNewWisher.php`  文件中,找到以下行:
 
 
-[source,java]
+[source,php]
 ----
 
-WishDB::getInstance()->create_wisher($_POST["user"], $_POST["password"]);
+WishDB::getInstance()->create_wisher($_POST['user'], $_POST['password']);
 ----
 
 然后,在其下输入以下代码块:
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
 $_SESSION['user'] = $_POST['user'];
 ----
 
-该代码块启动一个会话,这意味着打开  ``$_SESSION``  数组以输入或检索数据。然后,该代码在  ``$_SESSION``  数组中添加一个元素。添加的元素包含一个值和标识符(键)。该值是新创建的许愿者名字,标识符是 "user"。然后,程序将许愿者重定向到  ``editWishList.php``  页。
-
+该代码块启动一个会话,这意味着打开  `$_SESSION`  数组以输入或检索数据。然后,该代码在  `$_SESSION`  数组中添加一个元素。添加的元素包含一个值和标识符(键)。该值是新创建的许愿者名字,标识符是 "user"。然后,程序将许愿者重定向到  `editWishList.php`  页。
 
+[[_validating_user_logon]]
 == 验证用户登录
 
-当用户访问  ``editWishList.php``  页时,应用程序应确认刚才在  ``createNewWisher.php``  页上注册的同一个人访问了该页。
+当用户访问  `editWishList.php`  页时,应用程序应确认刚才在  `createNewWisher.php`  页上注册的同一个人访问了该页。
 
 实现该功能包括两个步骤:
 
-* <<retrievingUserNameFromSession,从会话中检索许愿者的名字>>
-* <<redirectingNotLoggedInUserToIndexPage,如果从会话中检索许愿者名字失败,将用户重定向到 index.php>>
-
+* <<_retrieving_the_wisher_s_name_from_the_session,从会话中检索许愿者的名字>>
+* <<_logging_in_from_the_index_php_page,如果从会话中检索许愿者名字失败,将用户重定向到 index.php>>
 
+[[_retrieving_the_wisher_s_name_from_the_session]]
 === 从会话中检索许愿者的名字
 
-将  ``editWishList.php``  的 PHP 块中的默认代码替换为以下内容:
+将  `editWishList.php`  的 PHP 块中的默认代码替换为以下内容:
 
-[source,java]
+[source,php]
 ----
 
 session_start();
 if (array_key_exists("user", $_SESSION)) {
-    echo "Hello " . $_SESSION['user'];
+  echo "Hello " . $_SESSION['user'];
 }
 ----
 
-该代码块打开  ``$_SESSION``  数组以检索数据,并验证  ``$_SESSION``  是否包含具有 "user" 标识符的元素。如果检查成功,该代码将输出欢迎消息。
+该代码块打开  `$_SESSION`  数组以检索数据,并验证  `$_SESSION`  是否包含具有 "user" 标识符的元素。如果检查成功,该代码将输出欢迎消息。
 
 检查是否正确实现会话:
 
-1. 运行  ``createNewWisher.php``  文件,然后创建一个新的许愿者,例如,Jack。
- ``editWishList.php``  打开,并显示 Hello Jack。
-2. 在浏览器中清除会话 Cookie,或者结束会话并从 IDE 中运行  ``editWishList.php`` 。
- ``editWishList.php``  文件打开并显示 Hello,因为没有通过会话传输任何用户。这是不正确的,因为它允许未登录和未注册的人创建或编辑愿望列表。为了避免出现该问题,需要将用户重定向到  ``index.php``  页。
-
+1. 运行  `createNewWisher.php`  文件,然后创建一个新的许愿者,例如,Jack。
+ `editWishList.php`  打开,并显示 Hello Jack。
+2. 在浏览器中清除会话 Cookie,或者结束会话并从 IDE 中运行  `editWishList.php` 。
+ `editWishList.php`  文件打开并显示 Hello,因为没有通过会话传输任何用户。这是不正确的,因为它允许未登录和未注册的人创建或编辑愿望列表。为了避免出现该问题,需要将用户重定向到  `index.php`  页。
 
+[[_logging_in_from_the_index_php_page]]
 === 重定向未登录的用户
 
-将以下代码块添加到  ``editWishList.php``  中的  ``if``  子句之下:
+将以下代码块添加到  `editWishList.php`  中的  `if`  子句之下:
 
-[source,java]
+[source,php]
 ----
 
 else {
-   header('Location: index.php');
-   exit;
+  header('Location: index.php');
+  exit;
 }
 ----
 
 该代码将用户重定向到 index.php 页并取消 PHP 代码执行。
 
-要检查是否正确实现了该功能,请运行  ``editWishList.php``  文件。预期的结果是打开  ``index.php``  页。
-
+要检查是否正确实现了该功能,请运行  `editWishList.php`  文件。预期的结果是打开  `index.php`  页。
 
+[[_html_form_for_logon_on_index_php]]
 == 从 index.php 页中登录
 
 从 index.php 页中登录包括两个步骤:
 
-* <<logonForm,在 HTML 输入窗体中输入用户的名字和口令,并将用于验证的数据提交到 index.php 页。>>
-* <<logonValidation,验证登录>>
-
+* <<_html_form_for_logon_on_index_php,在 HTML 输入窗体中输入用户的名字和口令,并将用于验证的数据提交到 index.php 页。>>
+* <<_logon_validation,验证登录>>
 
+[[_html_form_for_logon_on_index_php]]
 === 用于在 index.php 上登录的 HTML 窗体
 
-在  ``index.php``  文件中,在结束  ``</body>``  标记前输入以下代码:
+在  `index.php`  文件中,在结束  `</body>`  标记前输入以下代码:
 
 [source,xml]
 ----
 
 <form name="logon" action="index.php" method="POST" >
-    Username: <input type="text" name="user">
-    Password  <input type="password" name="userpassword">
-    <input type="submit" value="Edit My Wish List">
+  Username: <input type="text" name="user">
+  Password  <input type="password" name="userpassword">
+  <input type="submit" value="Edit My Wish List">
 </form>
 ----
 
@@ -196,18 +175,18 @@ else {
 
 该代码显示一个 link:wish-list-lesson3.html#htmlForm[+HTML 窗体+],用于在文本字段中输入用户的名字和口令。当用户单击 "Edit My Wish List" 时,数据将传输到同一页,即 index.php。
 
-
+[[_logon_validation]]
 === 登录验证
 
 登录验证包括:
 
-* <<checkWhereUserCameFrom,检查从中重定向用户的位置>>。
-* <<verifyCredentials,验证用户的名字和口令>>。
-* 将用户名保存到会话中并将用户重定向到 editWishList.php 页或<<displayErrorMessage,显示一条错误消息。>>
+* <<_logon_validation,检查从中重定向用户的位置>>。
+* <<_logon_validation,验证用户的名字和口令>>。
+* 将用户名保存到会话中并将用户重定向到 editWishList.php 页或<<_logon_validation,显示一条错误消息。>>
 
-用户可以在启动应用程序时访问  ``index.php``  页,从 <<validateWisherLogon,editWishList.php>> 页中进行访问,或者在输入名字和口令后从  ``index.php``  页中重定向时访问该页。
+用户可以在启动应用程序时访问  `index.php`  页,从 <<_function_verify_wisher_credentials,editWishList.php>> 页中进行访问,或者在输入名字和口令后从  `index.php`  页中重定向时访问该页。
 
-由于仅在最后一种情况下使用 link:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+HTML 请求方法+] POST,因此,您始终可以了解用户访问  ``index.php``  时所在的位置。
+由于仅在最后一种情况下使用 link:http://www.htmlcodetutorial.com/forms/_FORM_METHOD.html[+HTML 请求方法+] POST,因此,您始终可以了解用户访问  `index.php`  时所在的位置。
 
 在 index.php 文件中,使用以下代码在 HTML 块上面创建一个 <?php ?> 块:
 
@@ -215,107 +194,115 @@ else {
 ----
 
 <?php
-
 require_once("Includes/db.php");
-$logonSuccess = false;// verify user's credentials
+$logonSuccess = false;
+
+// verify user's credentials
 if ($_SERVER['REQUEST_METHOD'] == "POST") {
     $logonSuccess = (WishDB::getInstance()->verify_wisher_credentials($_POST['user'], $_POST['userpassword']));
     if ($logonSuccess == true) {
-        session_start();
-        $_SESSION['user'] = $_POST['user'];
-        header('Location: editWishList.php');
-        exit;
+      session_start();
+      $_SESSION['user'] = $_POST['user'];
+      header('Location: editWishList.php');
+      exit;
     }
 }
 ?>
-
 ----
 
-代码块顶部允许使用  ``db.php``  文件,并使用  ``false``  值初始化  ``$logonSuccess``  变量。如果验证成功,该值将变为  ``true`` 。
+代码块顶部允许使用  `db.php`  文件,并使用  `false`  值初始化  `$logonSuccess`  变量。如果验证成功,该值将变为  `true` 。
 
-验证用户凭证的代码先检查请求方法是否为 POST。如果请求方法是 POST,则在提交<<logonForm,登录窗体>>后重定向用户。在这种情况下,代码块使用在登录窗体中输入的名字和口令调用  ``verify_wisher_credentials``  函数。
+验证用户凭证的代码先检查请求方法是否为 POST。如果请求方法是 POST,则在提交<<_html_form_for_logon_on_index_php,登录窗体>>后重定向用户。在这种情况下,代码块使用在登录窗体中输入的名字和口令调用  `verify_wisher_credentials`  函数。
 
- ``verify_wisher_credentials``  函数(在<<verifyWisherCredentials,下一节>>中编写)检查  ``wishers``  表中是否存在用户和口令与<<logonForm,登录窗体>>中提交的值相匹配的记录。如果  ``verify_wisher_credentials``  函数返回  ``true`` ,则在数据库中注册一个具有指定名字和口令组合的许愿者。这表示验证成功,并且  ``$logonSuccess``  将值更改为  ``true`` 。在这种情况下,将启动一个会话并打开  ``$_SESSION``  数组。该代码在  ``$_SESSION``  数组中添加一个新元素。该元素包含一个值和标识符(键)。该值是许愿者的名字,标识符是 "user"。然后,该代码将用户重定向到  ``editWishList.php``  页以编辑愿望列表。
-
-如果  ``verify_wisher_credentials``  函数返回  ``false`` ,则  ``$logonSuccess``  变量值保持为 false。将使用该变量值<<displayErrorMessage,显示错误消息>>。
+ `verify_wisher_credentials`  函数(在<<_html_form_for_logon_on_index_php,下一节>>中编写)检查  `wishers`  表中是否存在用户和口令与<<_function_verify_wisher_credentials,登录窗体>>中提交的值相匹配的记录。如果  `verify_wisher_credentials`  函数返回  `true` ,则在数据库中注册一个具有指定名字和口令组合的许愿者。这表示验证成功,并且  `$logonSuccess`  将值更改为  `true` 。在这种情况下,将启动一个会话并打开  `$_SESSION`  数组。该代码在  `$_SESSION`  数组中添加一个新元素。该元素包含一个值和标识符(键)。该值是许愿者的名字,标识符是 "user"。然后,该代码将用户重定向到  `editWishList.php`  页以编辑愿望列表。
 
+如果  `verify_wisher_credentials`  函数返回  `false` ,则  `$logonSuccess`  变量值保持为 false。将使用该变量值<<_displaying_error_messages,显示错误消息>>。
 
+[[_function_verify_wisher_credentials]]
 === verify_wisher_credentials 函数
 
-要实现验证许愿者凭证的功能,您需要在  ``db.php``  文件的  ``WishDB``  类中添加一个新函数。该函数要求将名字和口令作为输入参数,并返回 0 或 1。
+要实现验证许愿者凭证的功能,您需要在  `db.php`  文件的  `WishDB`  类中添加一个新函数。该函数要求将名字和口令作为输入参数,并返回 0 或 1。
 
 *对于 MySQL 数据库*,请输入以下代码块:
 
-[source,java]
+[source,php]
 ----
 
-public function verify_wisher_credentials ($name, $password){$name = $this->real_escape_string($name);$password = $this->real_escape_string($password);$result = $this->query("SELECT 1 FROM wishers
- 	           WHERE name = '" . $name . "' AND password = '" . $password . "'");
-   return $result->data_seek(0);
+public function verify_wisher_credentials($name, $password) {
+  $name = $this->real_escape_string($name);
+  $password = $this->real_escape_string($password);
+  $result = $this->query("SELECT 1 FROM wishers WHERE name = '"
+                  . $name . "' AND password = '" . $password . "'");
+  return $result->data_seek(0);
 }
 ----
 
-*对于 Oracle 数据库*,请输入以下代码块(由于 OCI8 没有等效的  ``mysql_num_rows`` ,该代码是  ``get_wisher_id_by_name``  的修改形式):
+*对于 Oracle 数据库*,请输入以下代码块(由于 OCI8 没有等效的  `mysql_num_rows` ,该代码是  `get_wisher_id_by_name`  的修改形式):
 
 
-[source,java]
+[source,php]
 ----
 
 public function verify_wisher_credentials($name, $password) {
-    $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
-    $stid = oci_parse($this->con, $query);
-    oci_bind_by_name($stid, ':name_bv', $name);
-    oci_bind_by_name($stid, ':pwd_bv', $password);
-    oci_execute($stid);
+  $query = "SELECT 1 FROM wishers WHERE name = :name_bv AND password = :pwd_bv";
+  $stid = oci_parse($this->con, $query);
+  oci_bind_by_name($stid, ':name_bv', $name);
+  oci_bind_by_name($stid, ':pwd_bv', $password);
+  oci_execute($stid);
+
 //Because name is a unique value I only expect one row
-    $row = oci_fetch_array($stid, OCI_ASSOC);
-    if ($row) 
-        return true;
-    else
-        return false;
+  $row = oci_fetch_array($stid, OCI_ASSOC);
+  if ($row)
+    return true;
+  else
+    return false;
 }
 ----
 
-该代码块执行查询  ``"SELECT 1 FROM wishers WHERE Name = '" . $name . "'AND Password = '" . $password . "'"``  并返回满足指定查询的记录数。如果找到此类记录,该函数将返回  ``true`` 。如果在数据库中找不到此类记录,该函数将返回  ``false`` 。
-
+该代码块执行查询  `"SELECT 1 FROM wishers WHERE Name = '" . $name . "'AND Password = '" . $password . "'"`  并返回满足指定查询的记录数。如果找到此类记录,该函数将返回  `true` 。如果在数据库中找不到此类记录,该函数将返回  `false` 。
 
+[[_displaying_error_messages]]
 === 显示错误消息
 
-要允许应用程序显示错误消息,请输入以下 <? php ?> 代码块(在  ``index.php``  的登录窗体中的输入字段之下、按钮之上):
+要允许应用程序显示错误消息,请输入以下 <? php ?> 代码块(在  `index.php`  的登录窗体中的输入字段之下、按钮之上):
 
 [source,php]
 ----
 
 <?php
-  if ($_SERVER["REQUEST_METHOD"] == "POST") { 
-      if (!$logonSuccess)
-          echo "Invalid name and/or password";
-  }
+if ($_SERVER['REQUEST_METHOD'] == "POST") {
+  if (!$logonSuccess)
+    echo "Invalid name and/or password";
+}
 ?>
 ----
-该代码块检查 $logonSuccess 变量值;如果该值为 false,则显示一条错误消息。
 
+该代码块检查 $logonSuccess 变量值;如果该值为 false,则显示一条错误消息。
 
+[[_testing_the_logon_from_the_index_php_page]]
 == 测试从 index.php 页中登录
 
-检查登录功能在主页  ``index.php``  上是否正常工作:
+检查登录功能在主页  `index.php`  上是否正常工作:
 
 1. 运行应用程序。
-2. 在  ``index.php``  页上,在 "Username" 编辑框中输入 Tom,在 "Password" 编辑框中输入 Tim。
+2. 在  `index.php`  页上,在 "Username" 编辑框中输入 Tom,在 "Password" 编辑框中输入 Tim。
 3. 按 "Edit My Wish List"。将显示一条错误消息(请注意,下面的浏览器窗口宽度减小为 600px,其中添加了一些换行符): 
+
 image::images/incorrectNamePasswordIndex.png[]
+
 4. 在 "Username" 编辑框中输入 Tom,在 "Password" 编辑框中输入 tomcat。
 5. 按 "Edit My Wish list"。将显示 editWishList.php 页: 
-image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+image::images/SuccessfulLogonOnIndexRedirectToEditWishList.png[]
 
+[[application_source_code_after_the_current_lesson_is_completed]]
 == 完成当前课程后的应用程序源代码
 
 MySQL 用户:单击link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+此处+]以下载源代码,该代码反映了在完成课程后的项目状态。
 
 Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+此处+]以下载源代码,该代码反映了在完成课程后的项目状态。
 
-
+[[_next_steps]]
 == 后续步骤
 
 link:wish-list-lesson4.html[+<< 上一课+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6.asciidoc
index d5e02bf..598dde4 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6.asciidoc
@@ -41,72 +41,38 @@
 :keywords: Apache NetBeans, Tutorials, Lesson 6: Adding a New Wish to the Database
 
 
-Tutorial contents:
-
-1. link:wish-list-tutorial-main-page.html[+Creating a Database Driven Application With PHP - Main page+]
-2. 
-Creating the Database
-
-1. link:wish-list-lesson1.html[+Creating a MySQL Database+]
-2. link:wish-list-oracle-lesson1.html[+Creating Oracle Database Tables+]
-3. 
-link:wish-list-lesson2.html[+Designing the Application. Reading from the Database+]
-
-4. link:wish-list-lesson3.html[+Creating a New Application User +]
-5. link:wish-list-lesson4.html[+Optimizing the Code+]
-6. link:wish-list-lesson5.html[+Adding Security. Implementing Application User Logon+]
-7. 
-*=> Adding a New Wish to the Database*
-
-* <<previousLessonSourceCode,Application Source Code from the Previous Lesson>>
-* <<addNewWish,Submitting a New Wish>>
-* <<add-wish-ui-elements,Adding the User Interface Components>>
-* <<inputFormAfterunsuccessfulSave,Redisplaying the Due Date after an Unsuccessful Submission>>
-* <<logonVerification,Verifying the Wisher's Logon>>
-* <<insert-new-wish,Inserting the New Wish to the Database>>
-* <<add-insert-wish,Adding the insert_wish Function to WishDB>>
-* <<add-format-date-for-sql,Adding the format_date_for_sql Function to WishDB>>
-* <<validateAndEnterWishToDatabase,Entering the New Wish Record in the Database>>
-* <<displayingErrorMessages,Displaying Error Messages>>
-* <<backToIndex,Returning to the Front index.php Page>>
-* <<testingAddWishFunctionality,Testing the Add Wish Functionality>>
-* <<lessonResultSourceCode,Application Source Code after the Current Lesson Is Completed>>
-8. link:wish-list-lesson7.html[+Updating and Deleting Entries in the Database+]
-9. link:wish-list-lesson8.html[+Making the Application Look Better Using the CSS Technology+]
-10. link:wish-list-lesson9.html[+Deploying the Application on a Remote Web Server+]
-
 In this lesson you expand the application functionality with two features:
 
-* <<addNewWish,Adding a new wish>>
-* <<backToIndex,Returning to the front index.php page>>
+* <<_submitting_a_new_wish,Adding a new wish>>
+* <<_returning_to_the_front_index_php_page,Returning to the front index.php page>>
 
-To implement this functionality, you edit the  ``editWishList.php``  file and create the new file  ``editWish.php`` .
+To implement this functionality, you edit the  `editWishList.php`  file and create the new file  `editWish.php` .
 
 image::images/page-flow-diagram-l6.png[]
 
 The current document is a part of the link:wish-list-tutorial-main-page.html[+Creating a CRUD Application in the NetBeans IDE for PHP+] tutorial.
 
 
-
+[[_application_source_code_from_the_previous_lesson]]
 == Application Source Code from the Previous Lesson
 
-MySQL users: Click link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+ here+] to download the source code that reflects the project state after the previous lesson is completed.
-
-Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+ here+] to download the source code that reflects the project state after the previous lesson is completed.
+MySQL users: Click link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+here+] to download the source code that reflects the project state after the previous lesson is completed.
 
+Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+here+] to download the source code that reflects the project state after the previous lesson is completed.
 
+[[_submitting_a_new_wish]]
 == Submitting a New Wish
 
 The user submits a new wish in the following steps:
 
-1. The user logs in, switches to the  ``editWishList.php``  page, and presses the Add Wish button. The  ``editWish.php``  page opens, displaying an HTML form.
+1. The user logs in, switches to the  `editWishList.php`  page, and presses the Add Wish button. The  `editWish.php`  page opens, displaying an HTML form.
 2. In the HTML form, the user enters a description of a wish and possibly the date by when he/she wants it and presses the Save Changes button.
 3. If a form is submitted without a description of the wish, the user is returned to the form to try again. If the user submitted a due date but no description, that date is redisplayed when the form reloads.
 
 To enable this procedure for the user, you add the following functionality to the application:
 
-* <<add-wish-ui-elements,User interface components>>, consisting of an HTML form for adding wishes and a button in  ``editWishList.php `` that redirects the user to the form.
-* Code for <<inputFormAfterunsuccessfulSave,redisplaying the due date>> if an incomplete form is submitted.
+* <<add-wish-ui-elements,User interface components>>, consisting of an HTML form for adding wishes and a button in  `editWishList.php ` that redirects the user to the form.
+* Code for <<_redisplaying_the_due_date_after_an_unsuccessful_submission,redisplaying the due date>> if an incomplete form is submitted.
 
 
 [[add-wish-ui-elements]]
@@ -114,7 +80,7 @@ To enable this procedure for the user, you add the following functionality to th
 
 *To add functionality for adding a new wish:*
 
-1. Implement the Add Wish button. In the  ``editWishList.php``  file, add the following HTML code beneath the PHP block:
+1. Implement the Add Wish button. In the  `editWishList.php`  file, add the following HTML code beneath the PHP block:
 
 [source,xml]
 ----
@@ -122,8 +88,7 @@ To enable this procedure for the user, you add the following functionality to th
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
     <head>
-
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
         <form name="addNewWish" action="editWish.php">            
@@ -133,11 +98,11 @@ To enable this procedure for the user, you add the following functionality to th
 </html>
 ----
 
-*Note: *You can ignore warnings from the HTML validator.
+*Note:* You can ignore warnings from the HTML validator.
 
-The form contains an "Add Wish" input field of the  ``submit``  type. This field implements the "Add Wish" button. When the user clicks Add Wish, they are redirected to the  ``editWish.php``  page. Because no data is transferred through this form, no Server Request method is used.
+The form contains an "Add Wish" input field of the  `submit`  type. This field implements the "Add Wish" button. When the user clicks Add Wish, they are redirected to the  `editWish.php`  page. Because no data is transferred through this form, no Server Request method is used.
 
-2. Add a table above the addNewWish form that displays the existing wishes for the wisher. The code is similar to  ``wishlist.php`` .
+2. Add a table above the addNewWish form that displays the existing wishes for the wisher. The code is similar to  `wishlist.php` .
 
 *For the MySQL database*:
 
@@ -145,7 +110,20 @@ The form contains an "Add Wish" input field of the  ``submit``  type. This field
 [source,php]
 ----
 
-<table border="black"><tr><th>Item</th><th>Due Date</th></tr><?phprequire_once("Includes/db.php");$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);while($row = mysqli_fetch_array($result)) {echo "<tr><td>" . htmlentities($row['description']) . "</td>";echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";}?></table>
+<table border="black">
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
+    <?php
+    $result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+    while ($row = mysqli_fetch_array($result)) {
+        echo "<tr><td>" . htmlentities($row['description']) . "</td>";
+        echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
+</table>
 ----
 
 *For the Oracle database:*
@@ -155,18 +133,22 @@ The form contains an "Add Wish" input field of the  ``submit``  type. This field
 ----
 
 <table border="black">
-    <tr><th>Item</th><th>Due Date</th></tr>
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
     <?php
-    require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);
     $stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
-    while ($row = oci_fetch_array($stid)) {echo "<tr><td>" . htmlentities($row['DESCRIPTION']) . "</td>";echo "<td>" . htmlentities($row['DUE_DATE']) . "</td></tr>\n";
+    while ($row = oci_fetch_array($stid)) {
+        echo "<tr><td>" . htmlentities($row['DESCRIPTION']) . "</td>";
+        echo "<td>" . htmlentities($row['DUE_DATE']) . "</td></tr>\n";
     }
+    oci_free_statement($stid);
     ?>
 </table>
 ----
-3. Create the  ``editWish.php``  PHP file in the Source Files folder.
-4. In  ``editWish.php`` , implement the Add Wish form. Type or paste the following code below the <? php ?> block:
+3. Create the  `editWish.php`  PHP file in the Source Files folder.
+4. In  `editWish.php` , implement the Add Wish form. Type or paste the following code below the <? php ?> block:
 
 [source,xml]
 ----
@@ -176,10 +158,14 @@ The form contains an "Add Wish" input field of the  ``submit``  type. This field
 <html>
     <head>
 
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
-        <form name="editWish" action="editWish.php" method="POST">Describe your wish: <input type="text" name="wish"  value="" /><br/>When do you want to get it? <input type="text" name="dueDate" value=""/><br/><input type="submit" name="saveWish" value="Save Changes"/><input type="submit" name="back" value="Back to the List"/>
+        <form name="editWish" action="editWish.php" method="POST">
+            Describe your wish: <input type="text" name="wish"  value="" /><br/>
+            When do you want to get it? <input type="text" name="dueDate" value=""/><br/>
+            <input type="submit" name="saveWish" value="Save Changes"/>
+            <input type="submit" name="back" value="Back to the List"/>
         </form>
     </body>
 </html> 
@@ -189,39 +175,44 @@ The Add Wish form contains:
 
 * Two empty text fields for entering the wish description and due date.
 * The texts to be printed next to the input fields.
-* A  ``submit``  field that represents a Save Changes button
-* A  ``submit``  field that represents a Back to the List button for returning to the  ``editWishList.php``  page
-
-Upon pressing the Add Wish button, the form submits the entered data to the same page,  ``editWish.php`` , through the Request method POST.
+* A  `submit`  field that represents a Save Changes button
+* A  `submit`  field that represents a Back to the List button for returning to the  `editWishList.php`  page
 
+Upon pressing the Add Wish button, the form submits the entered data to the same page,  `editWish.php` , through the Request method POST.
 
+[[_redisplaying_the_due_date_after_an_unsuccessful_submission]]
 === Redisplaying the Due Date After an Unsuccessful Submission
 
-If the user does not fill in a description in the Add Wish form, an error message is displayed and the user returns to the  ``editWish.php``  page. When the user returns to  ``editWish.php`` , the Add Wish form should show the value of  ``dueDate``  if it was entered. In the current implementation of the form, both fields are always empty. To keep entered values, you need to save the data of the new wish in an array. The array will consist of two elements named  ``description``  and  ``d [...]
+If the user does not fill in a description in the Add Wish form, an error message is displayed and the user returns to the  `editWish.php`  page. When the user returns to  `editWish.php` , the Add Wish form should show the value of  `dueDate`  if it was entered. In the current implementation of the form, both fields are always empty. To keep entered values, you need to save the data of the new wish in an array. The array will consist of two elements named  `description`  and  `due_date`  [...]
 
-*Note: *The code that reloads the input form if no description is entered is included in the <<validateAndEnterWishToDatabase,code that validates the data and enters it to the database>>. This code is not described in this section. The code in this section only preserves the value of  ``dueDate``  so that it is displayed if the form is reloaded .
+*Note:* The code that reloads the input form if no description is entered is included in the <<_verifying_the_wisher_s_logon,code that validates the data and enters it to the database>>. This code is not described in this section. The code in this section only preserves the value of  `dueDate`  so that it is displayed if the form is reloaded .
 
 *To redisplay the input form after the user submits it unsuccessfully:*
 
-1. Type or paste the following code block inside the HTML <body> element of  ``editWish.php`` , directly above the input form:
+1. Type or paste the following code block inside the HTML <body> element of  `editWish.php` , directly above the input form:
 
 [source,php]
 ----
 
-<?php 
-if ($_SERVER["REQUEST_METHOD"] == "POST")$wish = array("description" => $_POST["wish"], "due_date" => $_POST["dueDate"]);else$wish = array("description" => "", "due_date" => "");
-?>  
+<?php
+if ($_SERVER['REQUEST_METHOD'] == "POST")
+    $wish = array("description" => $_POST['wish'],
+                        "due_date" => $_POST['dueDate']);
+else
+    $wish = array("description" => "",
+                        "due_date" => "");
+?>
 ----
 
-The code checks which Request Server method was used for transferring the data and creates an array named $wish. If the method is POST, which means that the input form is displayed after an unsuccessful attempt to save a wish with an empty description, the elements  ``description``  and  ``due_date``  accept the values transferred through POST.
+The code checks which Request Server method was used for transferring the data and creates an array named $wish. If the method is POST, which means that the input form is displayed after an unsuccessful attempt to save a wish with an empty description, the elements  `description`  and  `due_date`  accept the values transferred through POST.
 
-If the method is not POST, which means that the input form is displayed for the first time after redirection form the  ``editWishList.php``  page, the elements  ``description``  and  ``due_date``  are empty.
+If the method is not POST, which means that the input form is displayed for the first time after redirection form the  `editWishList.php`  page, the elements  `description`  and  `due_date`  are empty.
 
-NOTE: In either case the description is empty. The difference is only in the  ``dueDate`` .
+NOTE: In either case the description is empty. The difference is only in the  `dueDate` .
 
-2. Update the Add Wish form so that the values of its input fields are retrieved from the  ``$wish``  array. Replace the lines in the Add Wish form:
+2. Update the Add Wish form so that the values of its input fields are retrieved from the  `$wish`  array. Replace the lines in the Add Wish form:
 
-[source,java]
+[source,php]
 ----
 
 Describe your wish: <input type="text" name="wish"  value="" /><br/>
@@ -236,13 +227,13 @@ Describe your wish: <input type="text" name="wish"  value="<?php echo $wish['des
 When do you want to get it? <input type="text" name="dueDate" value="<?php echo $wish['due_date']; ?>"/><br/>
 ----
 
-
+[[_verifying_the_wisher_s_logon]]
 == Verifying the Wisher's Logon
 
-In the  ``editWish.php``  file, enter the following session handling code inside the <? php ?> block at the top of the file:
+In the  `editWish.php`  file, enter the following session handling code inside the <? php ?> block at the top of the file:
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
@@ -266,10 +257,10 @@ To check that session handling works correctly, run the editWish.php file from t
 
 After the user submits a new wish, the application needs to add the wish to the "wishes" database. To enable this functionality, add the following code to the application:
 
-* Add two more auxiliary functions to the  ``WishDB``  class in  ``db.php`` .
+* Add two more auxiliary functions to the  `WishDB`  class in  `db.php` .
 * One function adds a new record to the wishes table.
 * The other function converts dates into the format that the MySQL databases server supports.
-* Add code to  ``editWish.php``  that will use the new auxilliary functions in  ``WishDB``  to enter the new wish into the database.
+* Add code to  `editWish.php`  that will use the new auxilliary functions in  `WishDB`  to enter the new wish into the database.
 
 
 [[add-insert-wish]]
@@ -277,33 +268,40 @@ After the user submits a new wish, the application needs to add the wish to the
 
 This function requires the wisher's id, a description of the new wish, and the due date of the wish as the input parameters and enters this data to the database in a new record. The function does not return any values.
 
-Open  ``db.php ``  and add the function  ``insert_wish``  into the  ``WishDB `` class:
+Open  `db.php `  and add the function  `insert_wish`  into the  `WishDB ` class:
 
 *For the MySQL database*
 
 
-[source,java]
+[source,php]
 ----
 
-function insert_wish($wisherID, $description, $duedate){
-    $description = $this->real_escape_string($description);if ($this->format_date_for_sql($duedate)==null){$this->query("INSERT INTO wishes (wisher_id, description)" ." VALUES (" . $wisherID . ", '" . $description . "')");} else$this->query("INSERT INTO wishes (wisher_id, description, due_date)" . " VALUES (" . $wisherID . ", '" . $description . "', " . $this->format_date_for_sql($duedate) . ")");
+function insert_wish($wisherID, $description, $duedate) {
+    $description = $this->real_escape_string($description);
+    if ($this->format_date_for_sql($duedate)==null){
+       $this->query("INSERT INTO wishes (wisher_id, description)" .
+            " VALUES (" . $wisherID . ", '" . $description . "')");
+    } else
+        $this->query("INSERT INTO wishes (wisher_id, description, due_date)" .
+            " VALUES (" . $wisherID . ", '" . $description . "', "
+            . $this->format_date_for_sql($duedate) . ")");
 }
 ----
 
 *For the Oracle database:*
 
 
-[source,java]
+[source,php]
 ----
 
 function insert_wish($wisherID, $description, $duedate) {
-  $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))"; 
-  $stid = oci_parse($this->con, $query);
-  oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
-  oci_bind_by_name($stid, ':desc_bv', $description);
-  oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
-  oci_execute($stid);
-  oci_free_statement($stid);
+    $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))";
+    $stid = oci_parse($this->con, $query);
+    oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
+    oci_bind_by_name($stid, ':desc_bv', $description);
+    oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
+    oci_execute($stid);
+    oci_free_statement($stid);
 }
 ----
 
@@ -313,90 +311,96 @@ The code calls the function format_date_for_sql to convert the entered due date
 [[add-format-date-for-sql]]
 === Adding the format_date_for_sql Function to WishDB
 
-Add the function  ``format_date_for_sql``  to the  ``WishDB``  class in  ``db.php`` . The function requires a string with a date as the input parameter. The function returns a date in the format that can be processed by the database server or  ``null``  if the input string is empty.
+Add the function  `format_date_for_sql`  to the  `WishDB`  class in  `db.php` . The function requires a string with a date as the input parameter. The function returns a date in the format that can be processed by the database server or  `null`  if the input string is empty.
 
-NOTE: The function in this example uses the PHP  ``date_parse``  function. This function works only with English-language dates, such as December 25, 2010, and only Arabic numerals. A professional web site would use a date picker.
+NOTE: The function in this example uses the PHP  `date_parse`  function. This function works only with English-language dates, such as December 25, 2010, and only Arabic numerals. A professional web site would use a date picker.
 
 *For the MySQL database:*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){if ($date == "")return null;else {$dateParts = date_parse($date);return $dateParts["year"]*10000 + $dateParts["month"]*100 + $dateParts["day"];}}
+function format_date_for_sql($date) {
+    if ($date == "")
+        return null;
+    else {
+        $dateParts = date_parse($date);
+        return $dateParts["year"] * 10000 + $dateParts["month"] * 100 + $dateParts["day"];
+    }
+}
 ----
 
 *For the Oracle database:*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){
+function format_date_for_sql($date) {
     if ($date == "")
         return null;
     else {
         $dateParts = date_parse($date);
-        return $dateParts['year']*10000 + '-' + $dateParts['month']*100 + '-' + $dateParts['day'];
-   }
+        return $dateParts['year'] * 10000 + '-' + $dateParts['month'] * 100 + '-' + $dateParts['day'];
+    }
 }
 ----
 
-If the input string is empty, the code returns NULL. Otherwise, the internal  ``date_parse``  function is called with the  ``$date``  as the input parameter. The  ``date_parse``  function returns an array that consists of three elements named  ``$dateParts["year"]`` ,  ``$dateParts["month"]`` , and  ``$dateParts["day"]`` . The final output string is constructed of the elements of the  ``$dateParts``  array.
+If the input string is empty, the code returns NULL. Otherwise, the internal  `date_parse`  function is called with the  `$date`  as the input parameter. The  `date_parse`  function returns an array that consists of three elements named  `$dateParts["year"]` ,  `$dateParts["month"]` , and  `$dateParts["day"]` . The final output string is constructed of the elements of the  `$dateParts`  array.
 
-*Important:* The  ``date_parse``  function recognizes only English dates. For example, it parses "February 2, 2016" but not "2 Unora, 2016".
+*Important:* The  `date_parse`  function recognizes only English dates. For example, it parses "February 2, 2016" but not "2 Unora, 2016".
 
-*Note to Oracle Database users:* The only format requirement is that the format of the date in the  ``return $dateParts...``  statement matches the date format in the  ``to_date``  SQL function in the  ``insert_wish``  query.
+*Note to Oracle Database users:* The only format requirement is that the format of the date in the  `return $dateParts...`  statement matches the date format in the  `to_date`  SQL function in the  `insert_wish`  query.
 
 
 [[validateAndEnterWishToDatabase]]
 === Entering the New Wish Record in the Database
 
-Now that you have developed the auxiliary functions, add code to validate the new wish data and enter the data to the database if it is valid. If the data is not valid, the code must reload the Add Wish form. If the data is invalid because no description has been entered but there is a due date, the due date is saved and redisplayed when the form reloads, thanks to code you <<inputFormAfterunsuccessfulSave,developed earlier>>.
+Now that you have developed the auxiliary functions, add code to validate the new wish data and enter the data to the database if it is valid. If the data is not valid, the code must reload the Add Wish form. If the data is invalid because no description has been entered but there is a due date, the due date is saved and redisplayed when the form reloads, thanks to code you <<_returning_to_the_front_index_php_page,developed earlier>>.
 
-Enter the following code inside the top <? php?> block of  ``editWish.php`` , below the session handling code:
+Enter the following code inside the top <? php?> block of  `editWish.php` , below the session handling code:
 
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
-
-    $wishDescriptionIsEmpty = false;
-    if ($_SERVER['REQUEST_METHOD'] == "POST"){
-        if (array_key_exists("back", $_POST)) {
-           header('Location: editWishList.php' ); 
-           exit;
-        } else
-        if ($_POST['wish'] == "") {
-            $wishDescriptionIsEmpty =  true;
-        } 
-		 else {
-           WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
-           header('Location: editWishList.php' );
-           exit;
-        }
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
+
+$wishDescriptionIsEmpty = false;
+if ($_SERVER['REQUEST_METHOD'] == "POST"){
+    if (array_key_exists("back", $_POST)) {
+        header('Location: editWishList.php' ); 
+        exit;
+    } else
+    if ($_POST['wish'] == "") {
+        $wishDescriptionIsEmpty =  true;
+    } else {
+        WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
+        header('Location: editWishList.php' );
+        exit;
     }
+}
 	
 ----
 
 The code performs the following functions:
 
-* Enables the use of the  ``db.php``  file
-* Gets or creates an instance of the class  ``WishDB`` 
-* Retrieves the id of the wisher who is attempting to add a wish by calling the function  ``get_wisher_id_by_name`` 
-* Initializes the  ``$wishDescriptionIsEmpty``  flag, which will be used later for showing error messages.
-* Checks that the Request method is POST, which means that the data was submitted from the form for entering the wish data on the  ``editWish.php``  page itself.
-* Checks whether the  ``$_POST``  array contains an element with the "back" key
+* Enables the use of the  `db.php`  file
+* Gets or creates an instance of the class  `WishDB` 
+* Retrieves the id of the wisher who is attempting to add a wish by calling the function  `get_wisher_id_by_name` 
+* Initializes the  `$wishDescriptionIsEmpty`  flag, which will be used later for showing error messages.
+* Checks that the Request method is POST, which means that the data was submitted from the form for entering the wish data on the  `editWish.php`  page itself.
+* Checks whether the  `$_POST`  array contains an element with the "back" key
 
-If the  ``$_POST``  array contains an element with the "back" key, the Back to the List button was pressed before submitting the form. In this case the code redirects the user to the  ``editWishList.php``  without saving any data that was entered in the fields and stops PHP processing.
+If the  `$_POST`  array contains an element with the "back" key, the Back to the List button was pressed before submitting the form. In this case the code redirects the user to the  `editWishList.php`  without saving any data that was entered in the fields and stops PHP processing.
 
 If the $_POST array _does not_ contain an element with the "back" key, the data was submitted by pressing the Save Changes button. In this case the code validates whether the wish description is filled in. The code does it by checking whether the element with the "wish" key in the $_POST array is empty and, if the key is empty, changes the $wishDescriptionIsEmpty flag to true. Note that with no further code executed in the PHP block, the Add Wish form reloads.
 
-If the Back to the List button was not pressed and the wish description is filled in, the code calls the function  ``insert_wish``  with the wisher's id, the description, and the due date for the wish as the input parameters. The code then redirects the user to the  ``editWishList.php``  page and stops the PHP processing.
-
+If the Back to the List button was not pressed and the wish description is filled in, the code calls the function  `insert_wish`  with the wisher's id, the description, and the due date for the wish as the input parameters. The code then redirects the user to the  `editWishList.php`  page and stops the PHP processing.
 
+[[_displaying_error_messages]]
 === Displaying Error Messages
 
 If the user attempts to save a wish but has not entered a description for it, an error message must be displayed.
@@ -406,16 +410,19 @@ Enter the following <? php?> block inside the HTML input form, below the "Descri
 [source,php]
 ----
 
-<?phpif ($wishDescriptionIsEmpty) echo "Please enter description<br/>";?>
+<?php
+if ($wishDescriptionIsEmpty)
+    echo "Please enter description<br/>";
+?>
 ----
 
-The error message is displayed if the  ``$wishDescriptionIsEmpty``  flag is true. The flag is processed during the input form validation.
-
+The error message is displayed if the  `$wishDescriptionIsEmpty`  flag is true. The flag is processed during the input form validation.
 
+[[_returning_to_the_front_index_php_page]]
 == Returning to the Front index.php Page
 
 The user should be able to return to the front page of the application at any time by pressing a button. 
-To implement this functionality, enter the following HTML input form in the  ``editWishList.php``  file, before the closing </body> tag:
+To implement this functionality, enter the following HTML input form in the  `editWishList.php`  file, before the closing </body> tag:
 
 
 [source,xml]
@@ -426,30 +433,33 @@ To implement this functionality, enter the following HTML input form in the  ``e
 
 The form redirects the user to the front index.php page upon pressing the Back to Main Page button.
 
-
+[[_testing_the_add_wish_functionality]]
 == Testing the Add Wish Functionality
 
-1. Run the application. On the  ``index.php``  page, fill in the fields: in the Username field, enter "Tom", in the Password field, enter "tomcat".
+1. Run the application. On the  `index.php`  page, fill in the fields: in the Username field, enter "Tom", in the Password field, enter "tomcat".
 image::images/user-logon-to-edit-wish-list.png[]
-2. Press the Edit My Wish List button. The  ``editWishList.php``  page opens. 
+2. Press the Edit My Wish List button. The  `editWishList.php`  page opens. 
 image::images/edit-wish-list-add-wish.png[]
-3. Press the Back to Main Page button. The  ``index.php``  page opens.
-4. Logon as Tom and press the Edit My Wish List button again. The  ``editWishList.php``  page opens.
-5. Press the Add Wish button. The  ``editWish.php``  page opens. Fill in the form.
+3. Press the Back to Main Page button. The  `index.php`  page opens.
+4. Logon as Tom and press the Edit My Wish List button again. The  `editWishList.php`  page opens.
+5. Press the Add Wish button. The  `editWish.php`  page opens. Fill in the form.
+
 image::images/new-wish.png[] 
-Press the Back to the List button. The  ``editWishList.php``  page opens but the entered wish is not added.
-6. Press the Add Wish button again. The  ``editWish.php``  page opens. Fill in the due date and leave the description empty. Press the Save Changes button. The  ``editWish.php``  page displays the input form with an error message and filled in due date.
-7. Press the Add Wish button again. The  ``editWish.php``  page opens. Fill in the form and press the Save Changes button. The  ``editWishList.php``  page shows an updated list of wishes. 
-image::images/edit-wish-list-updated.png[]
 
+Press the Back to the List button. The  `editWishList.php`  page opens but the entered wish is not added.
+6. Press the Add Wish button again. The  `editWish.php`  page opens. Fill in the due date and leave the description empty. Press the Save Changes button. The  `editWish.php`  page displays the input form with an error message and filled in due date.
+7. Press the Add Wish button again. The  `editWish.php`  page opens. Fill in the form and press the Save Changes button. The  `editWishList.php`  page shows an updated list of wishes. 
 
-== Application Source Code after the Current Lesson Is Completed
+image::images/edit-wish-list-updated.png[]
 
-MySQL users: Click link:https://netbeans.org/files/documents/4/1932/lesson6.zip[+ here+] to download the source code that reflects the project state after the lesson is completed.
+[[_application_source_code_after_the_current_lesson_is_completed]]
+== Application Source Code after the Current Lesson Is Completed
 
-Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson6.zip[+ here+] to download the source code that reflects the project state after the lesson is completed.
+MySQL users: Click link:https://netbeans.org/files/documents/4/1932/lesson6.zip[+here+] to download the source code that reflects the project state after the lesson is completed.
 
+Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson6.zip[+here+] to download the source code that reflects the project state after the lesson is completed.
 
+[[_next_steps]]
 == Next Steps
 
 link:wish-list-lesson5.html[+<< Previous lesson+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_ja.asciidoc
index 17875a7..5124752 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_ja.asciidoc
@@ -43,57 +43,36 @@
 
 
 
-1. link:wish-list-tutorial-main-page.html[+PHPを使用するデータベース駆動型アプリケーションの作成 - メイン・ページ+]
-2. 
-データベースの作成
-
-1. link:wish-list-lesson1.html[+MySQLデータベースの作成+]
-2. link:wish-list-oracle-lesson1.html[+Oracleデータベース表の作成+]
-3. 
-link:wish-list-lesson2.html[+アプリケーションの設計。データベースからの読取り+]
-
-4. link:wish-list-lesson3.html[+新規アプリケーション・ユーザーの作成+]
-5. link:wish-list-lesson4.html[+コードの最適化+]
-6. link:wish-list-lesson5.html[+セキュリティの追加。アプリケーション・ユーザー・ログオンの実装+]
-7. 
-*=> データベースへの新しいウィッシュの追加*
-
-8. link:wish-list-lesson7.html[+データベース内のエントリの更新および削除+]
-9. link:wish-list-lesson8.html[+CSSテクノロジを使用したアプリケーションの外観の改良+]
-10. link:wish-list-lesson9.html[+リモートWebサーバーへのアプリケーションのデプロイ+]
-
-image::images/netbeans-stamp-80-74-73.png[title="このページの内容は、NetBeans IDE 7.2、7.3、7.4および8.0に適用されます"]
-
 このレッスンでは、次の2つの機能を使用してアプリケーションの機能を拡張します。
 
 
-この機能を実装するには、 ``editWishList.php`` ファイルを編集し、新しいファイル ``editWish.php`` を作成します。
+この機能を実装するには、 `editWishList.php` ファイルを編集し、新しいファイル `editWish.php` を作成します。
 
 image::images/page-flow-diagram-l6.png[]
 
 現在のドキュメントは、link:wish-list-tutorial-main-page.html[+PHP向けのNetBeans IDEでのCRUDアプリケーションの作成+]というチュートリアルの一部です。
 
 
-
+[[_application_source_code_from_the_previous_lesson]]
 == 前のレッスンからのアプリケーション・ソース・コード
 
 MySQLユーザー: 前のレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+ここ+]をクリックします。
 
 Oracleデータベース・ユーザー: 前のレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+ここ+]をクリックします。
 
-
+[[_submitting_a_new_wish]]
 == 新規ウィッシュの送信
 
 ユーザーは、次の手順で新しいウィッシュを送信します。
 
-1. ユーザーは、ログインして ``editWishList.php`` ページに切り替え、「Add Wish」ボタンを押します。 ``editWish.php`` ページが開き、HTMLフォームが表示されます。
+1. ユーザーは、ログインして `editWishList.php` ページに切り替え、「Add Wish」ボタンを押します。 `editWish.php` ページが開き、HTMLフォームが表示されます。
 2. HTMLフォームで、ユーザーはウィッシュの説明と、必要に応じてウィッシュが必要な期日を入力し、「Save Changes」ボタンをクリックします。
 3. ウィッシュの説明を入力せずにフォームを送信すると、ユーザーはもう一度実行するようにフォームに戻されます。ユーザーが説明なしで期日を送信した場合、その日付はフォームが再ロードされるときに再表示されます。
 
 ユーザーがこの手順を実行できるようにするには、アプリケーションに次の機能を追加します。
 
-* ウィッシュを追加するためのHTMLフォームと、ユーザーをフォームにリダイレクトする ``editWishList.php`` のボタンで構成された<<add-wish-ui-elements,ユーザー・インタフェース・コンポーネント>>。
-* 不完全なフォームが送信された場合に、<<inputFormAfterunsuccessfulSave,期日を再表示>>するためのコード。
+* ウィッシュを追加するためのHTMLフォームと、ユーザーをフォームにリダイレクトする `editWishList.php` のボタンで構成された<<add-wish-ui-elements,ユーザー・インタフェース・コンポーネント>>。
+* 不完全なフォームが送信された場合に、<<_redisplaying_the_due_date_after_an_unsuccessful_submission,期日を再表示>>するためのコード。
 
 
 [[add-wish-ui-elements]]
@@ -101,7 +80,7 @@ Oracleデータベース・ユーザー: 前のレッスンが完了した後の
 
 *新規ウィッシュを追加するための機能を追加するには:*
 
-1. 「Add Wish」ボタンを実装します。 ``editWishList.php`` ファイルで、次のHTMLコードをPHPブロックの下に追加します。
+1. 「Add Wish」ボタンを実装します。 `editWishList.php` ファイルで、次のHTMLコードをPHPブロックの下に追加します。
 
 [source,xml]
 ----
@@ -120,11 +99,11 @@ Oracleデータベース・ユーザー: 前のレッスンが完了した後の
 </html>
 ----
 
-*注意: *HTMLバリデータからの警告は無視できます。
+*注意:* HTMLバリデータからの警告は無視できます。
 
-フォームには、 ``submit`` 型の「Add Wish」入力フィールドが含まれています。このフィールドは「Add Wish」ボタンを実装します。ユーザーが「Add Wish」をクリックすると、 ``editWish.php`` ページにリダイレクトされます。データはこのフォームを介して転送されないため、サーバー・リクエスト・メソッドは使用されません。
+フォームには、 `submit` 型の「Add Wish」入力フィールドが含まれています。このフィールドは「Add Wish」ボタンを実装します。ユーザーが「Add Wish」をクリックすると、 `editWish.php` ページにリダイレクトされます。データはこのフォームを介して転送されないため、サーバー・リクエスト・メソッドは使用されません。
 
-2. ウィッシャの既存のウィッシュを表示する表をaddNewWishフォームの上に追加します。コードは ``wishlist.php`` と似ています。
+2. ウィッシャの既存のウィッシュを表示する表をaddNewWishフォームの上に追加します。コードは `wishlist.php` と似ています。
 
 *MySQLデータベースの場合*:
 
@@ -132,7 +111,20 @@ Oracleデータベース・ユーザー: 前のレッスンが完了した後の
 [source,php]
 ----
 
-<table border="black"><tr><th>Item</th><th>Due Date</th></tr><?phprequire_once("Includes/db.php");$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);while($row = mysqli_fetch_array($result)) {echo "<tr><td>" . htmlentities($row['description']) . "</td>";echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";}?></table>
+<table border="black">
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
+    <?php
+    $result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+    while ($row = mysqli_fetch_array($result)) {
+        echo "<tr><td>" . htmlentities($row['description']) . "</td>";
+        echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
+</table>
 ----
 
 *Oracleデータベースの場合:*
@@ -152,8 +144,8 @@ Oracleデータベース・ユーザー: 前のレッスンが完了した後の
     ?>
 </table>
 ----
-3. 「ソース・ファイル」フォルダで ``editWish.php``  PHPファイルを作成します。
-4.  ``editWish.php`` でAdd Wishフォームを実装します。次のコードを<?php?>ブロックの下に入力するか、または貼り付けます。
+3. 「ソース・ファイル」フォルダで `editWish.php`  PHPファイルを作成します。
+4.  `editWish.php` でAdd Wishフォームを実装します。次のコードを<?php?>ブロックの下に入力するか、または貼り付けます。
 
 [source,xml]
 ----
@@ -163,10 +155,14 @@ Oracleデータベース・ユーザー: 前のレッスンが完了した後の
 <html>
     <head>
 
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
-        <form name="editWish" action="editWish.php" method="POST">Describe your wish: <input type="text" name="wish"  value="" /><br/>When do you want to get it? <input type="text" name="dueDate" value=""/><br/><input type="submit" name="saveWish" value="Save Changes"/><input type="submit" name="back" value="Back to the List"/>
+        <form name="editWish" action="editWish.php" method="POST">
+            Describe your wish: <input type="text" name="wish"  value="" /><br/>
+            When do you want to get it? <input type="text" name="dueDate" value=""/><br/>
+            <input type="submit" name="saveWish" value="Save Changes"/>
+            <input type="submit" name="back" value="Back to the List"/>
         </form>
     </body>
 </html> 
@@ -176,39 +172,44 @@ Add Wishフォームには、次が含まれています。
 
 * ウィッシュの説明と期日を入力するための、2つの空のテキスト・フィールド。
 * 入力フィールドの横に出力されるテキスト。
-* 「Save Changes」ボタンを表す ``submit`` フィールド。
-*  ``editWishList.php`` ページに戻るための「Back to the List」ボタンを表す ``submit`` フィールド。
-
-「Add Wish」ボタンを押すと、フォームはリクエスト・メソッドPOSTを介して、入力したデータを同じ ``editWish.php`` ページに送信します。
+* 「Save Changes」ボタンを表す `submit` フィールド。
+*  `editWishList.php` ページに戻るための「Back to the List」ボタンを表す `submit` フィールド。
 
+「Add Wish」ボタンを押すと、フォームはリクエスト・メソッドPOSTを介して、入力したデータを同じ `editWish.php` ページに送信します。
 
+[[_redisplaying_the_due_date_after_an_unsuccessful_submission]]
 === 送信に失敗した後の期日の再表示
 
-ユーザーがAdd Wishフォームに説明を入力しなかった場合、エラー・メッセージが表示され、ユーザーは ``editWish.php`` ページに戻ります。ユーザーが ``editWish.php`` に戻ると、 ``dueDate`` を入力していた場合はAdd Wishフォームにその値が表示されます。現在のフォームの実装では、両方のフィールドは常に空です。入力した値を保持するには、新しいウィッシュのデータを配列に保存する必要があります。配列は ``description`` と ``due_date`` という名前の2つの要素で構成されます。配列から ``dueDate`` フィールドの値を取得するように、Add Wishフォームを変更する必要があります。
+ユーザーがAdd Wishフォームに説明を入力しなかった場合、エラー・メッセージが表示され、ユーザーは `editWish.php` ページに戻ります。ユーザーが `editWish.php` に戻ると、 `dueDate` を入力していた場合はAdd Wishフォームにその値が表示されます。現在のフォームの実装では、両方のフィールドは常に空です。入力した値を保持するには、新しいウィッシュのデータを配列に保存する必要があります。配列は `description` と `due_date` という名前の2つの要素で構成されます。配列から `dueDate` フィールドの値を取得するように、Add Wishフォームを変更する必要があります。
 
-*注意:* 説明が入力されていない場合に入力フォームを再ロードするコードは、<<validateAndEnterWishToDatabase,データを検証してデータベースに入力するコード>>に含まれています。このコードについては、この項では説明しません。この項のコードは、フォームが再ロードされた場合に ``dueDate`` の値が表示されるように、その値を保持するのみです。
+*注意:* 説明が入力されていない場合に入力フォームを再ロードするコードは、<<_verifying_the_wisher_s_logon,データを検証してデータベースに入力するコード>>に含まれています。このコードについては、この項では説明しません。この項のコードは、フォームが再ロードされた場合に `dueDate` の値が表示されるように、その値を保持するのみです。
 
 *ユーザーが入力フォームの送信に失敗した場合に入力フォームを再表示するには:*
 
-1. 次のコード・ブロックを、 ``editWish.php`` のHTML <body>要素内で、入力フォームの直前に入力するか、または貼り付けます。
+1. 次のコード・ブロックを、 `editWish.php` のHTML <body>要素内で、入力フォームの直前に入力するか、または貼り付けます。
 
 [source,php]
 ----
 
-<?php 
-if ($_SERVER["REQUEST_METHOD"] == "POST")$wish = array("description" => $_POST["wish"], "due_date" => $_POST["dueDate"]);else$wish = array("description" => "", "due_date" => "");
-?>  
+<?php
+if ($_SERVER['REQUEST_METHOD'] == "POST")
+    $wish = array("description" => $_POST['wish'],
+                        "due_date" => $_POST['dueDate']);
+else
+    $wish = array("description" => "",
+                        "due_date" => "");
+?>
 ----
 
-このコードは、データの転送にどのサーバー・リクエスト・メソッドが使用されたかを確認し、$wishという名前の配列を作成します。メソッドがPOSTの場合、つまり説明が空の状態でウィッシュを保存しようとして失敗した後に入力フォームが表示される場合、 ``description`` と ``due_date`` の要素はPOSTを介して転送された値を受け取ります。
+このコードは、データの転送にどのサーバー・リクエスト・メソッドが使用されたかを確認し、$wishという名前の配列を作成します。メソッドがPOSTの場合、つまり説明が空の状態でウィッシュを保存しようとして失敗した後に入力フォームが表示される場合、 `description` と `due_date` の要素はPOSTを介して転送された値を受け取ります。
 
-メソッドがPOSTでない場合、つまり ``editWishList.php`` ページからのリダイレクト後に初めて入力フォームが表示される場合、 ``description`` と ``due_date`` の要素は空です。
+メソッドがPOSTでない場合、つまり `editWishList.php` ページからのリダイレクト後に初めて入力フォームが表示される場合、 `description` と `due_date` の要素は空です。
 
-*注意:* どちらの場合も説明は空です。 ``dueDate`` が異なるのみです。
+*注意:* どちらの場合も説明は空です。 `dueDate` が異なるのみです。
 
-2. Add Wishフォームの入力フィールドの値が ``$wish`` 配列から取得されるように、Add Wishフォームを更新します。Add Wishフォームの次の行が対象です。
+2. Add Wishフォームの入力フィールドの値が `$wish` 配列から取得されるように、Add Wishフォームを更新します。Add Wishフォームの次の行が対象です。
 
-[source,java]
+[source,php]
 ----
 
 Describe your wish: <input type="text" name="wish"  value="" /><br/>
@@ -223,13 +224,13 @@ Describe your wish: <input type="text" name="wish"  value="<?php echo $wish['des
 When do you want to get it? <input type="text" name="dueDate" value="<?php echo $wish['due_date']; ?>"/><br/>
 ----
 
-
+[[_verifying_the_wisher_s_logon]]
 == ウィッシャのログオンの確認
 
- ``editWish.php`` ファイルで、ファイルの先頭の<? >ブロック内に次のセッション処理コードを入力します。
+ `editWish.php` ファイルで、ファイルの先頭の<? >ブロック内に次のセッション処理コードを入力します。
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
@@ -253,10 +254,10 @@ if (!array_key_exists("user", $_SESSION)) {
 
 ユーザーが新しいウィッシュを送信した後、アプリケーションはそのウィッシュを「wishes」データベースに追加する必要があります。この機能を有効にするには、次のコードをアプリケーションに追加します。
 
-*  ``db.php`` の ``WishDB`` クラスに、補助関数をさらに2つ追加する。
+*  `db.php` の `WishDB` クラスに、補助関数をさらに2つ追加する。
 * 1つの関数は、wishes表に新しいレコードを追加します。
 * もう1つの関数は、日付をMySQLデータベース・サーバーがサポートする形式に変換します。
-*  ``WishDB`` の新しい補助関数を使用してデータベースに新しいウィッシュを入力するコードを、 ``editWish.php`` に追加する。
+*  `WishDB` の新しい補助関数を使用してデータベースに新しいウィッシュを入力するコードを、 `editWish.php` に追加する。
 
 
 [[add-insert-wish]]
@@ -264,33 +265,40 @@ if (!array_key_exists("user", $_SESSION)) {
 
 この関数は、入力パラメータとして、ウィッシャのID、新しいウィッシュの説明、およびそのウィッシュの期日を必要とし、このデータをデータベースの新規レコードに入力します。この関数は値を返しません。
 
- ``db.php`` を開き、関数 ``insert_wish`` を ``WishDB`` クラスに追加します。
+ `db.php` を開き、関数 `insert_wish` を `WishDB` クラスに追加します。
 
 *MySQLデータベースの場合*
 
 
-[source,java]
+[source,php]
 ----
 
-function insert_wish($wisherID, $description, $duedate){
-    $description = $this->real_escape_string($description);if ($this->format_date_for_sql($duedate)==null){$this->query("INSERT INTO wishes (wisher_id, description)" ." VALUES (" . $wisherID . ", '" . $description . "')");} else$this->query("INSERT INTO wishes (wisher_id, description, due_date)" . " VALUES (" . $wisherID . ", '" . $description . "', " . $this->format_date_for_sql($duedate) . ")");
+function insert_wish($wisherID, $description, $duedate) {
+    $description = $this->real_escape_string($description);
+    if ($this->format_date_for_sql($duedate)==null){
+       $this->query("INSERT INTO wishes (wisher_id, description)" .
+            " VALUES (" . $wisherID . ", '" . $description . "')");
+    } else
+        $this->query("INSERT INTO wishes (wisher_id, description, due_date)" .
+            " VALUES (" . $wisherID . ", '" . $description . "', "
+            . $this->format_date_for_sql($duedate) . ")");
 }
 ----
 
 *Oracleデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
 function insert_wish($wisherID, $description, $duedate) {
-  $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))"; 
-  $stid = oci_parse($this->con, $query);
-  oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
-  oci_bind_by_name($stid, ':desc_bv', $description);
-  oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
-  oci_execute($stid);
-  oci_free_statement($stid);
+    $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))";
+    $stid = oci_parse($this->con, $query);
+    oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
+    oci_bind_by_name($stid, ':desc_bv', $description);
+    oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
+    oci_execute($stid);
+    oci_free_statement($stid);
 }
 ----
 
@@ -300,90 +308,96 @@ function insert_wish($wisherID, $description, $duedate) {
 [[add-format-date-for-sql]]
 === WishDBへのformat_date_for_sql関数の追加
 
-関数 ``format_date_for_sql`` を ``db.php`` 内の ``WishDB`` クラスに追加します。この関数は、入力パラメータとして日付の入った文字列を必要とします。この関数は、データベース・サーバーが処理できる形式で日付を返すか、または入力文字列が空の場合は ``null`` を返します。
+関数 `format_date_for_sql` を `db.php` 内の `WishDB` クラスに追加します。この関数は、入力パラメータとして日付の入った文字列を必要とします。この関数は、データベース・サーバーが処理できる形式で日付を返すか、または入力文字列が空の場合は `null` を返します。
 
-*注意:* この例の関数は、PHP  ``date_parse`` 関数を使用します。この関数は、「December 25, 2010」などの英語の日付でのみ機能し、アラビア数字専用です。高度なWebサイトでは日付ピッカーを使用します。
+*注意:* この例の関数は、PHP  `date_parse` 関数を使用します。この関数は、「December 25, 2010」などの英語の日付でのみ機能し、アラビア数字専用です。高度なWebサイトでは日付ピッカーを使用します。
 
 *MySQLデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){if ($date == "")return null;else {$dateParts = date_parse($date);return $dateParts["year"]*10000 + $dateParts["month"]*100 + $dateParts["day"];}}
+function format_date_for_sql($date) {
+    if ($date == "")
+        return null;
+    else {
+        $dateParts = date_parse($date);
+        return $dateParts["year"] * 10000 + $dateParts["month"] * 100 + $dateParts["day"];
+    }
+}
 ----
 
 *Oracleデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){
+function format_date_for_sql($date) {
     if ($date == "")
         return null;
     else {
         $dateParts = date_parse($date);
-        return $dateParts['year']*10000 + '-' + $dateParts['month']*100 + '-' + $dateParts['day'];
-   }
+        return $dateParts['year'] * 10000 + '-' + $dateParts['month'] * 100 + '-' + $dateParts['day'];
+    }
 }
 ----
 
-入力文字列が空の場合、このコードはNULLを返します。それ以外の場合は、入力パラメータとして ``$date`` を使用する内部の ``date_parse`` 関数がコールされます。 ``date_parse`` 関数は、 ``$dateParts["year"]`` 、 ``$dateParts["month"]`` 、および ``$dateParts["day"]`` の3つの要素から構成される配列を返します。最終的な出力文字列は、 ``$dateParts`` 配列の要素で構成されます。
+入力文字列が空の場合、このコードはNULLを返します。それ以外の場合は、入力パラメータとして `$date` を使用する内部の `date_parse` 関数がコールされます。 `date_parse` 関数は、 `$dateParts["year"]` 、 `$dateParts["month"]` 、および `$dateParts["day"]` の3つの要素から構成される配列を返します。最終的な出力文字列は、 `$dateParts` 配列の要素で構成されます。
 
-*重要:*  ``date_parse`` 関数は英語の日付のみ認識します。たとえば、「February 2, 2016」は解析しますが、「2 Unora, 2016」は解析しません。
+*重要:*  `date_parse` 関数は英語の日付のみ認識します。たとえば、「February 2, 2016」は解析しますが、「2 Unora, 2016」は解析しません。
 
-*Oracleデータベース・ユーザーへの注意:* 形式の要件は、 ``return$dateParts...`` 文の日付の形式が、 ``insert_wish`` 問合せの ``to_date``  SQL関数の日付形式と一致することのみです。
+*Oracleデータベース・ユーザーへの注意:* 形式の要件は、 `return$dateParts...` 文の日付の形式が、 `insert_wish` 問合せの `to_date`  SQL関数の日付形式と一致することのみです。
 
 
 [[validateAndEnterWishToDatabase]]
 === データベースへの新規ウィッシュ・レコードの入力
 
-補助関数の開発が完了したので、新規ウィッシュ・データを検証するコードを追加し、データが有効である場合は、そのデータをデータベースに入力します。データが有効でない場合、コードはAdd Wishフォームを再ロードする必要があります。期日が入力されているが説明が入力されていないためにデータが無効な場合、フォームが再ロードされるときに、<<inputFormAfterunsuccessfulSave,以前に開発したコード>>によって期日が保存され、再表示されます。
+補助関数の開発が完了したので、新規ウィッシュ・データを検証するコードを追加し、データが有効である場合は、そのデータをデータベースに入力します。データが有効でない場合、コードはAdd Wishフォームを再ロードする必要があります。期日が入力されているが説明が入力されていないためにデータが無効な場合、フォームが再ロードされるときに、<<_returning_to_the_front_index_php_page,以前に開発したコード>>によって期日が保存され、再表示されます。
 
-次のコードを、先頭の<?php?>ブロック( ``editWish.php`` 内)のセッション処理コードの下に入力します。
+次のコードを、先頭の<?php?>ブロック( `editWish.php` 内)のセッション処理コードの下に入力します。
 
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
-
-    $wishDescriptionIsEmpty = false;
-    if ($_SERVER['REQUEST_METHOD'] == "POST"){
-        if (array_key_exists("back", $_POST)) {
-           header('Location: editWishList.php' ); 
-           exit;
-        } else
-        if ($_POST['wish'] == "") {
-            $wishDescriptionIsEmpty =  true;
-        } 
-		 else {
-           WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
-           header('Location: editWishList.php' );
-           exit;
-        }
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
+
+$wishDescriptionIsEmpty = false;
+if ($_SERVER['REQUEST_METHOD'] == "POST"){
+    if (array_key_exists("back", $_POST)) {
+        header('Location: editWishList.php' ); 
+        exit;
+    } else
+    if ($_POST['wish'] == "") {
+        $wishDescriptionIsEmpty =  true;
+    } else {
+        WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
+        header('Location: editWishList.php' );
+        exit;
     }
-	
+}
+    
 ----
 
 このコードは次の関数を実行します。
 
-*  ``db.php`` ファイルの使用を有効にする。
-* クラス ``WishDB`` のインスタンスを取得または作成する。
-* 関数 ``get_wisher_id_by_name`` をコールして、ウィッシュを追加しようとしているウィッシャのIDを取得する。
-*  ``$wishDescriptionIsEmpty`` フラグを初期化する(これは、後でエラー・メッセージの表示に使用されます)。
-* リクエスト・メソッドがPOSTであることを確認する(これは、このデータが ``editWish.php`` ページ自身のウィッシュ・データを入力するためのフォームから送信されたことを意味します)。
-*  ``$_POST`` 配列が「back」キーを持つ要素を含んでいるかどうかを確認する。
+*  `db.php` ファイルの使用を有効にする。
+* クラス `WishDB` のインスタンスを取得または作成する。
+* 関数 `get_wisher_id_by_name` をコールして、ウィッシュを追加しようとしているウィッシャのIDを取得する。
+*  `$wishDescriptionIsEmpty` フラグを初期化する(これは、後でエラー・メッセージの表示に使用されます)。
+* リクエスト・メソッドがPOSTであることを確認する(これは、このデータが `editWish.php` ページ自身のウィッシュ・データを入力するためのフォームから送信されたことを意味します)。
+*  `$_POST` 配列が「back」キーを持つ要素を含んでいるかどうかを確認する。
 
- ``$_POST`` 配列が「back」キーを持つ要素を含んでいる場合、フォームを送信する前に「Back to the List」ボタンが押されます。この場合、コードは、フィールドに入力されたデータを保存せずにユーザーを ``editWishList.php`` にリダイレクトし、PHP処理を停止します。
+ `$_POST` 配列が「back」キーを持つ要素を含んでいる場合、フォームを送信する前に「Back to the List」ボタンが押されます。この場合、コードは、フィールドに入力されたデータを保存せずにユーザーを `editWishList.php` にリダイレクトし、PHP処理を停止します。
 
 $_POST配列が「back」キーを持つ要素を含んで_いない_場合、データは「Save Changes」ボタンを押すことによって送信されます。この場合、コードは、ウィッシュの説明が入力されているかどうかを検証します。コードは、$_POST配列内の「wish」キー持つ要素が空であるかどうかを確認し、キーが空の場合は$wishDescriptionIsEmptyフラグをtrueに変更します。PHPブロックのコードがさらに実行されることはなく、Add Wishフォームが再ロードされます。
 
-「Back to the List」ボタンが押されず、ウィッシュの説明が入力されている場合、コードは入力パラメータとしてウィッシャのID、ウィッシュの説明、およびウィッシュの期日を持つ関数 ``insert_wish`` をコールします。コードはユーザーを ``editWishList.php`` ページにリダイレクトし、PHP処理を停止します。
-
+「Back to the List」ボタンが押されず、ウィッシュの説明が入力されている場合、コードは入力パラメータとしてウィッシャのID、ウィッシュの説明、およびウィッシュの期日を持つ関数 `insert_wish` をコールします。コードはユーザーを `editWishList.php` ページにリダイレクトし、PHP処理を停止します。
 
+[[_displaying_error_messages]]
 === エラー・メッセージの表示
 
 ユーザーがウィッシュの説明を入力せずにウィッシュを保存しようとした場合、エラー・メッセージが表示されます。
@@ -393,16 +407,19 @@ $_POST配列が「back」キーを持つ要素を含んで_いない_場合、
 [source,php]
 ----
 
-<?phpif ($wishDescriptionIsEmpty) echo "Please enter description<br/>";?>
+<?php
+if ($wishDescriptionIsEmpty)
+    echo "Please enter description<br/>";
+?>
 ----
 
- ``$wishDescriptionIsEmpty`` フラグがtrueの場合は、エラー・メッセージが表示されます。フラグは、入力フォームの検証時に処理されます。
-
+ `$wishDescriptionIsEmpty` フラグがtrueの場合は、エラー・メッセージが表示されます。フラグは、入力フォームの検証時に処理されます。
 
+[[_returning_to_the_front_index_php_page]]
 == 最初のindex.phpページへの復帰
 
 ボタンを押すことによって、ユーザーがいつでもアプリケーションの最初のページに戻ることができるようにします。
-この機能を実装するには、次のHTML入力フォームを ``editWishList.php`` ファイルの終了</body>タグの前に入力します。
+この機能を実装するには、次のHTML入力フォームを `editWishList.php` ファイルの終了</body>タグの前に入力します。
 
 
 [source,xml]
@@ -413,30 +430,33 @@ $_POST配列が「back」キーを持つ要素を含んで_いない_場合、
 
 「Back to Main Page」ボタンを押すと、フォームは、ユーザーを最初のindex.phpページにリダイレクトします。
 
-
+[[_testing_the_add_wish_functionality]]
 == ウィッシュの追加機能のテスト
 
-1. アプリケーションを実行します。 ``index.php`` ページで、「Username」フィールドに「Tom」、「Password」フィールドに「tomcat」と入力します。
+1. アプリケーションを実行します。 `index.php` ページで、「Username」フィールドに「Tom」、「Password」フィールドに「tomcat」と入力します。
 image::images/user-logon-to-edit-wish-list.png[]
-2. 「Edit My Wish List」ボタンを押します。 ``editWishList.php`` ページが開きます。
+2. 「Edit My Wish List」ボタンを押します。 `editWishList.php` ページが開きます。
+
 image::images/edit-wish-list-add-wish.png[]
-3. 「Back to Main Page」ボタンを押します。 ``index.php`` ページが開きます。
-4. 「Tom」としてログオンし、もう一度「Edit My Wish List」ボタンを押します。 ``editWishList.php`` ページが開きます。
-5. 「Add Wish」ボタンを押します。 ``editWish.php`` ページが開きます。フォームに入力します。
+
+3. 「Back to Main Page」ボタンを押します。 `index.php` ページが開きます。
+4. 「Tom」としてログオンし、もう一度「Edit My Wish List」ボタンを押します。 `editWishList.php` ページが開きます。
+5. 「Add Wish」ボタンを押します。 `editWish.php` ページが開きます。フォームに入力します。
 image::images/new-wish.png[]
-「Back to the List」ボタンを押します。 ``editWishList.php`` ページが開きますが、入力したウィッシュは追加されていません。
-6. 再度「Add Wish」ボタンを押します。 ``editWish.php`` ページが開きます。期日を入力し、説明を空のままにします。「Save Changes」ボタンを押します。 ``editWish.php`` ページには、エラー・メッセージが表示され、期日が入力されている状態の入力フォームが表示されます。
-7. 再度「Add Wish」ボタンを押します。 ``editWish.php`` ページが開きます。フォームに入力し、「Save Changes」ボタンを押します。 ``editWishList.php`` ページに更新されたウィッシュのリストが表示されます。
-image::images/edit-wish-list-updated.png[]
+「Back to the List」ボタンを押します。 `editWishList.php` ページが開きますが、入力したウィッシュは追加されていません。
+6. 再度「Add Wish」ボタンを押します。 `editWish.php` ページが開きます。期日を入力し、説明を空のままにします。「Save Changes」ボタンを押します。 `editWish.php` ページには、エラー・メッセージが表示され、期日が入力されている状態の入力フォームが表示されます。
+7. 再度「Add Wish」ボタンを押します。 `editWish.php` ページが開きます。フォームに入力し、「Save Changes」ボタンを押します。 `editWishList.php` ページに更新されたウィッシュのリストが表示されます。
 
+image::images/edit-wish-list-updated.png[]
 
+[[_application_source_code_after_the_current_lesson_is_completed]]
 == 現在のレッスン完了後のアプリケーション・ソース・コード
 
 MySQLユーザー: このレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/files/documents/4/1932/lesson6.zip[+ここ+]をクリックします。
 
 Oracleデータベース・ユーザー: このレッスンが完了した後のプロジェクトの状態を反映したソース・コードをダウンロードするには、link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson6.zip[+ここ+]をクリックします。
 
-
+[[_next_steps]]
 == 次の手順
 
 link:wish-list-lesson5.html[+<< 前のレッスン+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_pt_BR.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_pt_BR.asciidoc
index d7ce911..043acc2 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_pt_BR.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_pt_BR.asciidoc
@@ -42,58 +42,36 @@
 :keywords: Apache NetBeans, Tutorials, Lição 6: Adicionado um Novo Desejo ao Banco de Dados
 
 
-
-1. link:wish-list-tutorial-main-page.html[+Criando uma Aplicação Orientada pelo Banco de Dados com o PHP - Página Principal+]
-2. 
-Criando o Banco de Dados
-
-1. link:wish-list-lesson1.html[+Criando um Banco de Dados MySQL+]
-2. link:wish-list-oracle-lesson1.html[+Criando Tabelas do Banco de Dados Oracle+]
-3. 
-link:wish-list-lesson2.html[+Projetando a Aplicação. Lendo o Banco de Dados+]
-
-4. link:wish-list-lesson3.html[+Criando um Novo Usuário de Aplicação+]
-5. link:wish-list-lesson4.html[+Otimizando o Código+]
-6. link:wish-list-lesson5.html[+Adicionando Segurança. Implementando o Log-in de Usuário da Aplicação+]
-7. 
-*=> Adicionando um Novo Desejo ao Banco de Dados*
-
-8. link:wish-list-lesson7.html[+Atualizando e Deletando Entradas no Banco de Dados+]
-9. link:wish-list-lesson8.html[+Melhorando a Aparência da Aplicação Usando a Tecnologia CSS+]
-10. link:wish-list-lesson9.html[+Implantando a Aplicação em um Servidor Web Remoto+]
-
-image::images/netbeans-stamp-80-74-73.png[title="O conteúdo desta página se aplica ao NetBeans IDE 7.2, 7.3, 7.4 e 8.0"]
-
 Nesta lição, você expande a funcionalidade da aplicação com duas funcionalidades:
 
 
-Para implementar essa funcionalidade, edite o arquivo  ``editWishList.php``  e crie um novo arquivo  ``editWish.php`` .
+Para implementar essa funcionalidade, edite o arquivo  `editWishList.php`  e crie um novo arquivo  `editWish.php` .
 
 image::images/page-flow-diagram-l6.png[]
 
 O documento atual é uma parte do tutorial Criando uma Aplicação CRUD no NetBeans IDE para PHP.
 
 
-
+[[_application_source_code_from_the_previous_lesson]]
 == Código-fonte da Aplicação da Lição Anterior
 
 Usuários MySQL: clique link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição anterior for concluída.
 
 Usuários do banco de dados Oracle: clique link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição anterior for concluída.
 
-
+[[_submitting_a_new_wish]]
 == Enviando um Novo Desejo
 
 O usuário envia um novo desejo nas seguintes etapas:
 
-1. O usuário faz log-in, alterna para a página  ``editWishList.php``  e pressiona o botão Adicionar Desejo. A página  ``editWish.php``  abre, exibindo um form HTML.
+1. O usuário faz log-in, alterna para a página  `editWishList.php`  e pressiona o botão Adicionar Desejo. A página  `editWish.php`  abre, exibindo um form HTML.
 2. No form HTML, o usuário insere uma descrição de um desejo e, possivelmente, a data quando deseja recebê-lo e pressiona o botão Salvar Alterações.
 3. Se um form for enviado sem uma descrição do desejo, o usuário retorna ao form para tentar novamente. Caso o usuário tenha enviado uma data de vencimento mas nenhuma descrição, essa data é exibida novamente quando o form é recarregado.
 
 Para ativar esse procedimento para o usuário, adicione a seguinte funcionalidade à aplicação:
 
-* <<add-wish-ui-elements,Componentes da interface do usuário>>, consistindo em um form HTML para adicionar desejos e um botão em  ``editWishList.php `` que redireciona o usuário para o form.
-* Código para <<inputFormAfterunsuccessfulSave,reexibir a data de vencimento>> se um form incompleto for enviado.
+* <<add-wish-ui-elements,Componentes da interface do usuário>>, consistindo em um form HTML para adicionar desejos e um botão em  `editWishList.php ` que redireciona o usuário para o form.
+* Código para <<_redisplaying_the_due_date_after_an_unsuccessful_submission,reexibir a data de vencimento>> se um form incompleto for enviado.
 
 
 [[add-wish-ui-elements]]
@@ -101,7 +79,7 @@ Para ativar esse procedimento para o usuário, adicione a seguinte funcionalidad
 
 *Para adicionar funcionalidade para a adição um novo desejo:*
 
-1. Implementar o botão Adicionar Desejo. No arquivo  ``editWishList.php`` , adicione o seguinte código HTML abaixo do bloco PHP:
+1. Implementar o botão Adicionar Desejo. No arquivo  `editWishList.php` , adicione o seguinte código HTML abaixo do bloco PHP:
 
 [source,xml]
 ----
@@ -109,8 +87,7 @@ Para ativar esse procedimento para o usuário, adicione a seguinte funcionalidad
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
     <head>
-
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
         <form name="addNewWish" action="editWish.php">            
@@ -120,11 +97,11 @@ Para ativar esse procedimento para o usuário, adicione a seguinte funcionalidad
 </html>
 ----
 
-*Observação: *você pode ignorar as advertências do validador HTML.
+*Observação:* você pode ignorar as advertências do validador HTML.
 
-O form contém um campo de entrada "Adicionar Desejo" do tipo  ``submit`` . Este campo implementa o botão "Adicionar desejo". Quando o usuário clica em Adicionar Desejo, ele é redirecionado para a página  ``editWish.php`` . Como nenhum dado é transferido usando esse form, nenhum método de Solicitação do Servidor é usado.
+O form contém um campo de entrada "Adicionar Desejo" do tipo  `submit` . Este campo implementa o botão "Adicionar desejo". Quando o usuário clica em Adicionar Desejo, ele é redirecionado para a página  `editWish.php` . Como nenhum dado é transferido usando esse form, nenhum método de Solicitação do Servidor é usado.
 
-2. Adicione uma tabela acima do form addNewWish que exibe os desejos existentes para o wisher. O código é semelhante ao código  ``wishlist.php`` .
+2. Adicione uma tabela acima do form addNewWish que exibe os desejos existentes para o wisher. O código é semelhante ao código  `wishlist.php` .
 
 *Para o banco de dados MySQL:*
 
@@ -132,7 +109,20 @@ O form contém um campo de entrada "Adicionar Desejo" do tipo  ``submit`` . Este
 [source,php]
 ----
 
-<table border="black"><tr><th>Item</th><th>Due Date</th></tr><?phprequire_once("Includes/db.php");$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);while($row = mysqli_fetch_array($result)) {echo "<tr><td>" . htmlentities($row['description']) . "</td>";echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";}?></table>
+<table border="black">
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
+    <?php
+    $result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+    while ($row = mysqli_fetch_array($result)) {
+        echo "<tr><td>" . htmlentities($row['description']) . "</td>";
+        echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
+</table>
 ----
 
 *Para o banco de dados Oracle:*
@@ -142,18 +132,22 @@ O form contém um campo de entrada "Adicionar Desejo" do tipo  ``submit`` . Este
 ----
 
 <table border="black">
-    <tr><th>Item</th><th>Due Date</th></tr>
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
     <?php
-    require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);
     $stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
-    while ($row = oci_fetch_array($stid)) {echo "<tr><td>" . htmlentities($row['DESCRIPTION']) . "</td>";echo "<td>" . htmlentities($row['DUE_DATE']) . "</td></tr>\n";
+    while ($row = oci_fetch_array($stid)) {
+        echo "<tr><td>" . htmlentities($row['DESCRIPTION']) . "</td>";
+        echo "<td>" . htmlentities($row['DUE_DATE']) . "</td></tr>\n";
     }
+    oci_free_statement($stid);
     ?>
 </table>
 ----
-3. Crie o arquivo PHP  ``editWish.php``  na pasta Código-fonte.
-4. Em  ``editWish.php`` , implemente o form Adicionar Desejo. Digite ou cole o seguinte código abaixo do bloco <? php?>:
+3. Crie o arquivo PHP  `editWish.php`  na pasta Código-fonte.
+4. Em  `editWish.php` , implemente o form Adicionar Desejo. Digite ou cole o seguinte código abaixo do bloco <? php?>:
 
 [source,xml]
 ----
@@ -163,10 +157,14 @@ O form contém um campo de entrada "Adicionar Desejo" do tipo  ``submit`` . Este
 <html>
     <head>
 
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
-        <form name="editWish" action="editWish.php" method="POST">Describe your wish: <input type="text" name="wish"  value="" /><br/>When do you want to get it? <input type="text" name="dueDate" value=""/><br/><input type="submit" name="saveWish" value="Save Changes"/><input type="submit" name="back" value="Back to the List"/>
+        <form name="editWish" action="editWish.php" method="POST">
+            Describe your wish: <input type="text" name="wish"  value="" /><br/>
+            When do you want to get it? <input type="text" name="dueDate" value=""/><br/>
+            <input type="submit" name="saveWish" value="Save Changes"/>
+            <input type="submit" name="back" value="Back to the List"/>
         </form>
     </body>
 </html> 
@@ -176,39 +174,44 @@ O form Adicionar Desejo contém:
 
 * Dois campos de texto vazios para inserção da descrição e a data de vencimento do desejo.
 * Textos a serem impressos ao lado dos campos de entrada.
-* Um campo  ``submit``  que representa um botão Salvar Alterações
-* Um campo  ``submit``  que representa um botão Voltar à Lista para retornar à página  ``editWishList.php`` 
-
-Quando o botão Adicionar Desejo é pressionado, o form envia os dados inseridos para a mesma página,  ``editWish.php`` , usando o método de Solicitação POST.
+* Um campo  `submit`  que representa um botão Salvar Alterações
+* Um campo  `submit`  que representa um botão Voltar à Lista para retornar à página  `editWishList.php` 
 
+Quando o botão Adicionar Desejo é pressionado, o form envia os dados inseridos para a mesma página,  `editWish.php` , usando o método de Solicitação POST.
 
+[[_redisplaying_the_due_date_after_an_unsuccessful_submission]]
 === Reexibindo a Data de Vencimento Após um Envio Malsucedido
 
-Se o usuário não preencher uma descrição no form Adicionar Desejo, uma mensagem de erro é exibida e o usuário retorna à página  ``editWish.php`` . Quando o usuário retorna ao  ``editWish.php`` , o form Adicionar Desejo deve mostrar o valor de  ``dueDate``  caso ele tenha sido inserido. Na implementação atual do form, ambos os campos estão sempre vazios. Para manter os valores inseridos, você precisa salvar os dados do novo desejo em um array. O array consistirá em dois elementos chamados [...]
+Se o usuário não preencher uma descrição no form Adicionar Desejo, uma mensagem de erro é exibida e o usuário retorna à página  `editWish.php` . Quando o usuário retorna ao  `editWish.php` , o form Adicionar Desejo deve mostrar o valor de  `dueDate`  caso ele tenha sido inserido. Na implementação atual do form, ambos os campos estão sempre vazios. Para manter os valores inseridos, você precisa salvar os dados do novo desejo em um array. O array consistirá em dois elementos chamados  `des [...]
 
-*Observação: *O código que recarrega o form de entrada, caso nenhuma descrição tenha sido inserida, é incluído no <<validateAndEnterWishToDatabase,código que valida os dados e insere-os no banco de dados>>. Esse código não é descrito nesta seção. O código desta seção preserva somente o valor de  ``dueDate``  para que ele seja exibido se o form for recarregado.
+*Observação:* O código que recarrega o form de entrada, caso nenhuma descrição tenha sido inserida, é incluído no <<_verifying_the_wisher_s_logon,código que valida os dados e insere-os no banco de dados>>. Esse código não é descrito nesta seção. O código desta seção preserva somente o valor de  `dueDate`  para que ele seja exibido se o form for recarregado.
 
 *Para reexibir o form de entrada depois que o usuário o envia sem êxito:*
 
-1. Digite ou cole o bloco de código seguinte dentro do elemento HTML <body> de  ``editWish.php`` , diretamente acima do form de entrada:
+1. Digite ou cole o bloco de código seguinte dentro do elemento HTML <body> de  `editWish.php` , diretamente acima do form de entrada:
 
 [source,php]
 ----
 
-<?php 
-if ($_SERVER["REQUEST_METHOD"] == "POST")$wish = array("description" => $_POST["wish"], "due_date" => $_POST["dueDate"]);else$wish = array("description" => "", "due_date" => "");
-?>  
+<?php
+if ($_SERVER['REQUEST_METHOD'] == "POST")
+    $wish = array("description" => $_POST['wish'],
+                        "due_date" => $_POST['dueDate']);
+else
+    $wish = array("description" => "",
+                        "due_date" => "");
+?>
 ----
 
-O código verifica qual método de Solicitação de Servidor foi usado para transferir os dados e cria um array chamado $wish. Se o método for POST, o que significa que o form de entrada é exibido depois de uma tentativa malsucedida de salvar um desejo com uma descrição vazia, os elementos  ``description``  e  ``due_date``  aceitam os valores transferidos pelo POST.
+O código verifica qual método de Solicitação de Servidor foi usado para transferir os dados e cria um array chamado $wish. Se o método for POST, o que significa que o form de entrada é exibido depois de uma tentativa malsucedida de salvar um desejo com uma descrição vazia, os elementos  `description`  e  `due_date`  aceitam os valores transferidos pelo POST.
 
-Se o método não for POST, o que significa que o form de entrada é exibido pela primeira vez depois do redirecionamento do form para a página  ``editWishList.php`` , os elementos  ``description``  e  ``due_date``  ficam vazios.
+Se o método não for POST, o que significa que o form de entrada é exibido pela primeira vez depois do redirecionamento do form para a página  `editWishList.php` , os elementos  `description`  e  `due_date`  ficam vazios.
 
-*Observação:* Em ambos os casos a descrição fica vazia. Há diferença apenas em  ``dueDate`` .
+*Observação:* Em ambos os casos a descrição fica vazia. Há diferença apenas em  `dueDate` .
 
-2. Atualize o form Adicionar Desejo para que os valores de seus campos de entrada sejam recuperados do array  ``$wish`` . Substitua as linhas no form Adicionar Desejo:
+2. Atualize o form Adicionar Desejo para que os valores de seus campos de entrada sejam recuperados do array  `$wish` . Substitua as linhas no form Adicionar Desejo:
 
-[source,java]
+[source,php]
 ----
 
 Describe your wish: <input type="text" name="wish"  value="" /><br/>
@@ -223,13 +226,13 @@ Describe your wish: <input type="text" name="wish"  value="<?php echo $wish['des
 When do you want to get it? <input type="text" name="dueDate" value="<?php echo $wish['due_date']; ?>"/><br/>
 ----
 
-
+[[_verifying_the_wisher_s_logon]]
 == Verificando o Log-in do Wisher
 
-No arquivo  ``editWish.php`` , insira o seguinte código de manipulação de sessão dentro do bloco <? php?> na parte superior do arquivo:
+No arquivo  `editWish.php` , insira o seguinte código de manipulação de sessão dentro do bloco <? php?> na parte superior do arquivo:
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
@@ -253,10 +256,10 @@ Para verificar se a manipulação da sessão funciona corretamente, execute o ar
 
 Depois que o usuário envia um novo desejo, a aplicação precisa adicionar o desejo ao banco de dados "desejos". Para ativar essa funcionalidade, adicione o seguinte código à aplicação:
 
-* Adicione mais duas funções auxiliares à classe  ``WishDB``  em  ``db.php`` .
+* Adicione mais duas funções auxiliares à classe  `WishDB`  em  `db.php` .
 * Uma função adiciona um novo registro à tabela de desejos.
 * A outra função converte as datas para o formato aceito pelo servidor de bancos de dados MySQL.
-* Adicione o código ao  ``editWish.php`` , que usará as novas funções auxiliares em  ``WishDB``  para inserir o novo desejo no banco de dados.
+* Adicione o código ao  `editWish.php` , que usará as novas funções auxiliares em  `WishDB`  para inserir o novo desejo no banco de dados.
 
 
 [[add-insert-wish]]
@@ -264,33 +267,40 @@ Depois que o usuário envia um novo desejo, a aplicação precisa adicionar o de
 
 Essa função requer o wisher ID, uma descrição do novo desejo e a data de vencimento do desejo como parâmetros de entrada e insere esses dados no banco de dados em um novo registro. A função não retorna valores.
 
-Abra o  ``db.php ``  e adicione a função  ``insert_wish``  na classe  ``WishDB `` :
+Abra o  `db.php `  e adicione a função  `insert_wish`  na classe  `WishDB ` :
 
 *Para o banco de dados MySQL*
 
 
-[source,java]
+[source,php]
 ----
 
-function insert_wish($wisherID, $description, $duedate){
-    $description = $this->real_escape_string($description);if ($this->format_date_for_sql($duedate)==null){$this->query("INSERT INTO wishes (wisher_id, description)" ." VALUES (" . $wisherID . ", '" . $description . "')");} else$this->query("INSERT INTO wishes (wisher_id, description, due_date)" . " VALUES (" . $wisherID . ", '" . $description . "', " . $this->format_date_for_sql($duedate) . ")");
+function insert_wish($wisherID, $description, $duedate) {
+    $description = $this->real_escape_string($description);
+    if ($this->format_date_for_sql($duedate)==null){
+       $this->query("INSERT INTO wishes (wisher_id, description)" .
+            " VALUES (" . $wisherID . ", '" . $description . "')");
+    } else
+        $this->query("INSERT INTO wishes (wisher_id, description, due_date)" .
+            " VALUES (" . $wisherID . ", '" . $description . "', "
+            . $this->format_date_for_sql($duedate) . ")");
 }
 ----
 
 *Para o banco de dados Oracle:*
 
 
-[source,java]
+[source,php]
 ----
 
 function insert_wish($wisherID, $description, $duedate) {
-  $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))"; 
-  $stid = oci_parse($this->con, $query);
-  oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
-  oci_bind_by_name($stid, ':desc_bv', $description);
-  oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
-  oci_execute($stid);
-  oci_free_statement($stid);
+    $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))";
+    $stid = oci_parse($this->con, $query);
+    oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
+    oci_bind_by_name($stid, ':desc_bv', $description);
+    oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
+    oci_execute($stid);
+    oci_free_statement($stid);
 }
 ----
 
@@ -300,90 +310,96 @@ O código chama a função format_date_for_sql para converter a data de vencimen
 [[add-format-date-for-sql]]
 === Adicionando a função format_date_for_sql ao WishDB
 
-Adicione a função  ``format_date_for_sql``  à classe  ``WishDB``  em  ``db.php`` . A função exige uma string com uma data como parâmetro de entrada. A função retorna uma data no formato que pode ser processado pelo servidor de banco de dados ou  ``null``  se a string de entrada estiver vazia.
+Adicione a função  `format_date_for_sql`  à classe  `WishDB`  em  `db.php` . A função exige uma string com uma data como parâmetro de entrada. A função retorna uma data no formato que pode ser processado pelo servidor de banco de dados ou  `null`  se a string de entrada estiver vazia.
 
-*Observação:* a função nesse exemplo usa a função  ``date_parse``  PHP. Essa função funciona apenas com datas em Inglês, como December 25, 2010 e apenas com algarismos arábicos. Um site profissional deve usar um selecionador de data.
+*Observação:* a função nesse exemplo usa a função  `date_parse`  PHP. Essa função funciona apenas com datas em Inglês, como December 25, 2010 e apenas com algarismos arábicos. Um site profissional deve usar um selecionador de data.
 
 *Para o banco de dados MySQL:*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){if ($date == "")return null;else {$dateParts = date_parse($date);return $dateParts["year"]*10000 + $dateParts["month"]*100 + $dateParts["day"];}}
+function format_date_for_sql($date) {
+    if ($date == "")
+        return null;
+    else {
+        $dateParts = date_parse($date);
+        return $dateParts["year"] * 10000 + $dateParts["month"] * 100 + $dateParts["day"];
+    }
+}
 ----
 
 *Para o banco de dados Oracle:*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){
+function format_date_for_sql($date) {
     if ($date == "")
         return null;
     else {
         $dateParts = date_parse($date);
-        return $dateParts['year']*10000 + '-' + $dateParts['month']*100 + '-' + $dateParts['day'];
-   }
+        return $dateParts['year'] * 10000 + '-' + $dateParts['month'] * 100 + '-' + $dateParts['day'];
+    }
 }
 ----
 
-Se a string de entrada estiver vazia, o código retorna NULL (nulo). Caso contrário, a função  ``date_parse``  interna é chamada com  ``$date``  como parâmetro de entrada. A função  ``date_parse``  retorna um array que consiste em três elementos chamados  ``$dateParts["ano"]`` ,  ``$dateParts["mês"]``  e  ``$dateParts["dia"]`` . A string de saída final é construída com base nos elementos do array  ``$dateParts`` .
+Se a string de entrada estiver vazia, o código retorna NULL (nulo). Caso contrário, a função  `date_parse`  interna é chamada com  `$date`  como parâmetro de entrada. A função  `date_parse`  retorna um array que consiste em três elementos chamados  `$dateParts["ano"]` ,  `$dateParts["mês"]`  e  `$dateParts["dia"]` . A string de saída final é construída com base nos elementos do array  `$dateParts` .
 
-*Importante:* a função  ``date_parse``  reconhece apenas datas em Inglês. Por exemplo, faz parsing para "February 2, 2016" mas não para "2 Unora, 2016".
+*Importante:* a função  `date_parse`  reconhece apenas datas em Inglês. Por exemplo, faz parsing para "February 2, 2016" mas não para "2 Unora, 2016".
 
-*Observação para usuários do banco de dados Oracle: * o único formato necessário é que o formato da data na instrução  ``return $dateParts...``  coincida com o formato da data na função SQL  ``to_date``  na consulta  ``insert_wish`` .
+*Observação para usuários do banco de dados Oracle: * o único formato necessário é que o formato da data na instrução  `return $dateParts...`  coincida com o formato da data na função SQL  `to_date`  na consulta  `insert_wish` .
 
 
 [[validateAndEnterWishToDatabase]]
 === Inserindo o Registro do Novo Desejo no Banco de Dados
 
-Agora que você desenvolveu as funções auxiliares, adicione o código para validar os novos dados do desejo e insira os dados para o banco de dados, se eles forem válidos. Se os dados não forem válidos, o código deve recarregar o form Adicionar Desejo. Se os dados forem inválidos porque nenhuma descrição foi inserida, mas existe uma data de vencimento, a data de vencimento é salva e reexibida quando o form é recarregado, graças ao código que você <<inputFormAfterunsuccessfulSave,desenvolve [...]
+Agora que você desenvolveu as funções auxiliares, adicione o código para validar os novos dados do desejo e insira os dados para o banco de dados, se eles forem válidos. Se os dados não forem válidos, o código deve recarregar o form Adicionar Desejo. Se os dados forem inválidos porque nenhuma descrição foi inserida, mas existe uma data de vencimento, a data de vencimento é salva e reexibida quando o form é recarregado, graças ao código que você <<_returning_to_the_front_index_php_page,de [...]
 
-Insira o código seguinte no bloco <? php?> de  ``editWish.php`` , abaixo do código de tratamento de sessão:
+Insira o código seguinte no bloco <? php?> de  `editWish.php` , abaixo do código de tratamento de sessão:
 
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
-
-    $wishDescriptionIsEmpty = false;
-    if ($_SERVER['REQUEST_METHOD'] == "POST"){
-        if (array_key_exists("back", $_POST)) {
-           header('Location: editWishList.php' ); 
-           exit;
-        } else
-        if ($_POST['wish'] == "") {
-            $wishDescriptionIsEmpty =  true;
-        } 
-		 else {
-           WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
-           header('Location: editWishList.php' );
-           exit;
-        }
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
+
+$wishDescriptionIsEmpty = false;
+if ($_SERVER['REQUEST_METHOD'] == "POST"){
+    if (array_key_exists("back", $_POST)) {
+        header('Location: editWishList.php' ); 
+        exit;
+    } else
+    if ($_POST['wish'] == "") {
+        $wishDescriptionIsEmpty =  true;
+    } else {
+        WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
+        header('Location: editWishList.php' );
+        exit;
     }
-	
+}
+  
 ----
 
 O código realiza as seguintes funções:
 
-* Permite o uso do arquivo  ``db.php`` 
-* Obtém ou cria uma instância da classe  ``WishDB`` 
-* Recupera o wisher ID que está tentando adicionar um desejo chamando a função  ``get_wisher_id_by_name`` 
-* Inicializa o flag  ``$wishDescriptionIsEmpty`` , que será usado mais tarde para mostrar mensagens de erro.
-* Verifica se o método de Solicitação é POST, o que significa que os dados foram enviados do form para inserir os dados do desejo na própria página  ``editWish.php`` .
-* Verifica se o array  ``$_POST``  contém um elemento com a chave "back"
+* Permite o uso do arquivo  `db.php` 
+* Obtém ou cria uma instância da classe  `WishDB` 
+* Recupera o wisher ID que está tentando adicionar um desejo chamando a função  `get_wisher_id_by_name` 
+* Inicializa o flag  `$wishDescriptionIsEmpty` , que será usado mais tarde para mostrar mensagens de erro.
+* Verifica se o método de Solicitação é POST, o que significa que os dados foram enviados do form para inserir os dados do desejo na própria página  `editWish.php` .
+* Verifica se o array  `$_POST`  contém um elemento com a chave "back"
 
-Se o array  ``$_POST``  contém um elemento com a chave "back", o botão Voltar à Lista foi pressionado antes de o form ser enviado. Nesse caso, o código redireciona o usuário para o  ``editWishList.php``  sem salvar os dados que foram inseridos nos campos e para o processamento de PHP.
+Se o array  `$_POST`  contém um elemento com a chave "back", o botão Voltar à Lista foi pressionado antes de o form ser enviado. Nesse caso, o código redireciona o usuário para o  `editWishList.php`  sem salvar os dados que foram inseridos nos campos e para o processamento de PHP.
 
 Se o array $_POST _não_ contiver um elemento com a chave "back", é porque os dados foram enviados quando o botão Salvar Alterações foi pressionado. Nesse caso, o código valida se a descrição do desejo está preenchida. O código faz isso, verificando se o elemento com a chave "wish" no array $_POST está vazio e, se a chave estiver vazia, altera o flag $wishDescriptionIsEmpty para verdadeiro. Observe que como nenhum código adicional é executado no bloco PHP, o form Adicionar Desejo é recarregado.
 
-Se o botão Voltar à Lista não foi pressionado e a descrição do desejo foi preenchida, o código chama a função  ``insert_wish``  com o wisher ID e a data de vencimento do desejo como os parâmetros de entrada. Em seguida, o código redireciona o usuário para a página  ``editWishList.php``  e para o processamento de PHP.
-
+Se o botão Voltar à Lista não foi pressionado e a descrição do desejo foi preenchida, o código chama a função  `insert_wish`  com o wisher ID e a data de vencimento do desejo como os parâmetros de entrada. Em seguida, o código redireciona o usuário para a página  `editWishList.php`  e para o processamento de PHP.
 
+[[_displaying_error_messages]]
 === Exibindo Mensagens de Erro
 
 Se o usuário tentar salvar um desejo mas não tiver inserido uma descrição para ele, deve ser exibida uma mensagem de erro.
@@ -393,16 +409,19 @@ Insira o seguinte bloco <? php?> dentro do form de entrada HTML, abaixo do campo
 [source,php]
 ----
 
-<?phpif ($wishDescriptionIsEmpty) echo "Please enter description<br/>";?>
+<?php
+if ($wishDescriptionIsEmpty)
+    echo "Please enter description<br/>";
+?>
 ----
 
-A mensagem de erro será exibida se o flag  ``$wishDescriptionIsEmpty``  for verdadeira. O flag será processado durante a validação do form de entrada.
-
+A mensagem de erro será exibida se o flag  `$wishDescriptionIsEmpty`  for verdadeira. O flag será processado durante a validação do form de entrada.
 
+[[_returning_to_the_front_index_php_page]]
 == Retornando à Página Inicial index.php
 
 O usuário deve poder retornar à página inicial da aplicação a qualquer momento pressionando um botão. 
-Para implementar essa funcionalidade, insira o seguinte form de entrada HTML no arquivo  ``editWishList.php`` , antes da tag de fechamento </body>:
+Para implementar essa funcionalidade, insira o seguinte form de entrada HTML no arquivo  `editWishList.php` , antes da tag de fechamento </body>:
 
 
 [source,xml]
@@ -413,30 +432,34 @@ Para implementar essa funcionalidade, insira o seguinte form de entrada HTML no
 
 O form redireciona o usuário para a página inicial index.php quando o botão Voltar à Página Principal é pressionado.
 
-
+[[_testing_the_add_wish_functionality]]
 == Testando a Funcionalidade Adicionar Desejo
 
-1. Execute a aplicação. Na página  ``index.php`` , preencha os campos: no campo Nome do Usuário, insira "Tom", e no campo Senha, insira "tomcat".
+1. Execute a aplicação. Na página  `index.php` , preencha os campos: no campo Nome do Usuário, insira "Tom", e no campo Senha, insira "tomcat".
+
 image::images/user-logon-to-edit-wish-list.png[]
-2. Pressione o botão Editar Minha Lista de Desejos. A página  ``editWishList.php``  abre. 
+
+2. Pressione o botão Editar Minha Lista de Desejos. A página  `editWishList.php`  abre. 
 image::images/edit-wish-list-add-wish.png[]
-3. Pressione o botão Voltar à Página Principal. A página  ``index.php``  abre.
-4. Faça log-in como Tom e pressione o botão Editar Minha Lista de Desejos novamente. A página  ``editWishList.php``  abre.
-5. Pressione o botão Adicionar Desejo. A página  ``editWish.php``  abre. Preencha o form.
+3. Pressione o botão Voltar à Página Principal. A página  `index.php`  abre.
+4. Faça log-in como Tom e pressione o botão Editar Minha Lista de Desejos novamente. A página  `editWishList.php`  abre.
+5. Pressione o botão Adicionar Desejo. A página  `editWish.php`  abre. Preencha o form.
+
 image::images/new-wish.png[] 
-Pressione o botão Voltar à Lista. A página  ``editWishList.php``  abre, mas o desejo inserido não foi adicionado.
-6. Pressione o botão Adicionar Desejo novamente. A página  ``editWish.php``  abre. Preencha a data de vencimento e deixe a descrição vazia. Pressione o botão Salvar Alterações. A página  ``editWish.php``  exibe o form de entrada com uma mensagem de erro e a data de vencimento preenchida.
-7. Pressione o botão Adicionar Desejo novamente. A página  ``editWish.php``  abre. Preencha o form e pressione o botão Salvar Alterações. A página  ``editWishList.php``  mostra uma lista de desejos atualizada. 
-image::images/edit-wish-list-updated.png[]
 
+Pressione o botão Voltar à Lista. A página  `editWishList.php`  abre, mas o desejo inserido não foi adicionado.
+6. Pressione o botão Adicionar Desejo novamente. A página  `editWish.php`  abre. Preencha a data de vencimento e deixe a descrição vazia. Pressione o botão Salvar Alterações. A página  `editWish.php`  exibe o form de entrada com uma mensagem de erro e a data de vencimento preenchida.
+7. Pressione o botão Adicionar Desejo novamente. A página  `editWish.php`  abre. Preencha o form e pressione o botão Salvar Alterações. A página  `editWishList.php`  mostra uma lista de desejos atualizada. 
+image::images/edit-wish-list-updated.png[]
 
+[[_application_source_code_after_the_current_lesson_is_completed]]
 == O código-fonte da Aplicação após a Lição Atual está Concluído
 
 Usuários MySQL: clique link:https://netbeans.org/files/documents/4/1932/lesson6.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição estiver concluída.
 
 Usuários do banco de dados Oracle: clique link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson6.zip[+aqui+] para fazer o download do código-fonte que reflete o estado do projeto depois que a lição for concluída.
 
-
+[[_next_steps]]
 == Próximas Etapas
 
 link:wish-list-lesson5.html[+<< Lição anterior+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_ru.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_ru.asciidoc
index 6ea2521..a5db041 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_ru.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_ru.asciidoc
@@ -42,57 +42,35 @@
 :keywords: Apache NetBeans, Tutorials, Урок 6. Добавление нового пожелания в базу данных
 
 
-
-1. link:wish-list-tutorial-main-page.html[+Создание приложения на основе базы данных с помощью языка PHP – главная страница+]
-2. 
-Создание базы данных
-
-1. link:wish-list-lesson1.html[+Создание базы данных MySQL+]
-2. link:wish-list-oracle-lesson1.html[+Создание таблиц базы данных Oracle+]
-3. 
-link:wish-list-lesson2.html[+Проектирование приложения. Чтение из базы данных+]
-
-4. link:wish-list-lesson3.html[+Создание нового пользователя приложения+]
-5. link:wish-list-lesson4.html[+Усовершенствование кода+]
-6. link:wish-list-lesson5.html[+Добавление функций безопасности. Реализация входа пользователя в приложение+]
-7. 
-*=> Добавление нового пожелания в базу данных*
-
-8. link:wish-list-lesson7.html[+Обновление и удаление записей в базе данных+]
-9. link:wish-list-lesson8.html[+Усовершенствование внешнего вида приложения с использованием технологии CSS+]
-10. link:wish-list-lesson9.html[+Развертывание приложения на удаленном веб-сервере+]
-
-image::images/netbeans-stamp-80-74-73.png[title="Содержимое этой страницы применимо к IDE NetBeans 7.2, 7.3, 7.4 и 8.0"]
-
 В этом уроке функциональные возможности приложения будут расширены двумя компонентами:
 
 
-Для реализации этих функциональных возможностей следует изменить файл  ``editWishList.php``  и создать новый файл  ``editWish.php`` .
+Для реализации этих функциональных возможностей следует изменить файл  `editWishList.php`  и создать новый файл  `editWish.php` .
 
 image::images/page-flow-diagram-l6.png[]
 
 Текущий документ является частью краткого учебного курса link:wish-list-tutorial-main-page.html[+Создание приложения CRUD в IDE NetBeans для PHP+].
 
 
-
+[[_application_source_code_from_the_previous_lesson]]
 == Исходный код приложения из предыдущего урока
 
 Для пользователей MySQL: щелкните link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+ здесь+], чтобы загрузить исходный код, отражающий состояние проекта после завершения предыдущего урока.
 
 Для пользователей баз данных Oracle: перейдите по link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+этой+] для загрузки исходного кода, описывающего состояние проекта на момент завершения предыдущего урока.
 
-
+[[_submitting_a_new_wish]]
 == Отправка нового пожелания
 
 Пользователь выполняет отправку нового пожелания путем выполнения следующих действий:
 
-1. Пользователь входит в систему, переключается на страницу  ``editWishList.php``  и нажимает кнопку "Add Wish". Откроется страница  ``editWish.php`` , на которой отображается форма HTML.
+1. Пользователь входит в систему, переключается на страницу  `editWishList.php`  и нажимает кнопку "Add Wish". Откроется страница  `editWish.php` , на которой отображается форма HTML.
 2. В форме HTML пользователь вводит описание пожелания и, возможно, дату, до наступления которой пожелание должно быть выполнено, а затем нажимает кнопку "Save Changes".
 3. Если форма отправляется без описания пожелания, то выполняется возврат к этой же форме для повторной попытки ввода. Если пользователь указал срок выполнения пожелания, но не ввел описание, то при перезагрузке формы эти данные вновь отображаются.
 
 Для предоставления пользователю возможности использования этой процедуры необходимо добавить к приложению следующие функциональные возможности:
 
-* <<add-wish-ui-elements,Компоненты интерфейса пользователя>>, состоящие из формы HTML для добавления пожелания и кнопки на странице  ``editWishList.php `` , перенаправляющей пользователя в форму.
+* <<add-wish-ui-elements,Компоненты интерфейса пользователя>>, состоящие из формы HTML для добавления пожелания и кнопки на странице  `editWishList.php ` , перенаправляющей пользователя в форму.
 * Код для <<inputFormAfterunsuccessfulSave,повторного отображения срока выполнения>>, если была отправлена неполная форма.
 
 
@@ -101,7 +79,7 @@ image::images/page-flow-diagram-l6.png[]
 
 *Для реализации функции добавления нового пожелания выполните следующее:*
 
-1. Создайте кнопку "Add Wish". В файле  ``editWishList.php``  ниже блока PHP добавьте следующий код HTML.
+1. Создайте кнопку "Add Wish". В файле  `editWishList.php`  ниже блока PHP добавьте следующий код HTML.
 
 [source,xml]
 ----
@@ -109,8 +87,7 @@ image::images/page-flow-diagram-l6.png[]
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
     <head>
-
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
         <form name="addNewWish" action="editWish.php">            
@@ -120,19 +97,31 @@ image::images/page-flow-diagram-l6.png[]
 </html>
 ----
 
-*Примечание. *Можно пропустить предупреждения от средства проверки HTML.
+*Примечание.* Можно пропустить предупреждения от средства проверки HTML.
 
-Форма содержит поле ввода "Add Wish" типа  ``submit`` . Это поле реализует кнопку "Add Wish". При нажатии кнопки "Add Wish" пользователь перенаправляется на страницу  ``editWish.php`` . Метод запроса к серверу не используется, т.к. данные посредством этой формы не передаются.
+Форма содержит поле ввода "Add Wish" типа  `submit` . Это поле реализует кнопку "Add Wish". При нажатии кнопки "Add Wish" пользователь перенаправляется на страницу  `editWish.php` . Метод запроса к серверу не используется, т.к. данные посредством этой формы не передаются.
 
-2. Выше формы addNewWish добавьте таблицу, в которой отображаются пожелания данного лица. Этот код сходен с кодом  ``wishlist.php`` .
+2. Выше формы addNewWish добавьте таблицу, в которой отображаются пожелания данного лица. Этот код сходен с кодом  `wishlist.php` .
 
 *Для базы данных MySQL*
 
-
 [source,php]
 ----
 
-<table border="black"><tr><th>Item</th><th>Due Date</th></tr><?phprequire_once("Includes/db.php");$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);while($row = mysqli_fetch_array($result)) {echo "<tr><td>" . htmlentities($row['description']) . "</td>";echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";}?></table>
+<table border="black">
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
+    <?php
+    $result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+    while ($row = mysqli_fetch_array($result)) {
+        echo "<tr><td>" . htmlentities($row['description']) . "</td>";
+        echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
+</table>
 ----
 
 *Для базы данных Oracle*
@@ -142,18 +131,22 @@ image::images/page-flow-diagram-l6.png[]
 ----
 
 <table border="black">
-    <tr><th>Item</th><th>Due Date</th></tr>
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
     <?php
-    require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);
     $stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
-    while ($row = oci_fetch_array($stid)) {echo "<tr><td>" . htmlentities($row['DESCRIPTION']) . "</td>";echo "<td>" . htmlentities($row['DUE_DATE']) . "</td></tr>\n";
+    while ($row = oci_fetch_array($stid)) {
+        echo "<tr><td>" . htmlentities($row['DESCRIPTION']) . "</td>";
+        echo "<td>" . htmlentities($row['DUE_DATE']) . "</td></tr>\n";
     }
+    oci_free_statement($stid);
     ?>
 </table>
 ----
-3. В папке исходных файлов создайте файл PHP  ``editWish.php`` .
-4. На станице  ``editWish.php``  реализуйте форму "Add Wish". Введите или вставьте следующий код под блоком <? php ? >:
+3. В папке исходных файлов создайте файл PHP  `editWish.php` .
+4. На станице  `editWish.php`  реализуйте форму "Add Wish". Введите или вставьте следующий код под блоком <? php ? >:
 
 [source,xml]
 ----
@@ -163,10 +156,14 @@ image::images/page-flow-diagram-l6.png[]
 <html>
     <head>
 
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
-        <form name="editWish" action="editWish.php" method="POST">Describe your wish: <input type="text" name="wish"  value="" /><br/>When do you want to get it? <input type="text" name="dueDate" value=""/><br/><input type="submit" name="saveWish" value="Save Changes"/><input type="submit" name="back" value="Back to the List"/>
+        <form name="editWish" action="editWish.php" method="POST">
+            Describe your wish: <input type="text" name="wish"  value="" /><br/>
+            When do you want to get it? <input type="text" name="dueDate" value=""/><br/>
+            <input type="submit" name="saveWish" value="Save Changes"/>
+            <input type="submit" name="back" value="Back to the List"/>
         </form>
     </body>
 </html> 
@@ -176,39 +173,44 @@ image::images/page-flow-diagram-l6.png[]
 
 * Два пустых текстовых поля для ввода пожелания и срока выполнения.
 * Текст, который будет напечатан рядом с полями ввода.
-* Поле  ``submit`` , представляющее кнопку "Save Changes"
-* Поле  ``submit`` , представляющее кнопку "Back to the List" для возврата к странице  ``editWishList.php`` 
-
-После нажатия кнопки "Add Wish" форма отправляет введенные данные на ту же страницу  ``editWish.php``  с использованием метода "Request" "POST".
+* Поле  `submit` , представляющее кнопку "Save Changes"
+* Поле  `submit` , представляющее кнопку "Back to the List" для возврата к странице  `editWishList.php` 
 
+После нажатия кнопки "Add Wish" форма отправляет введенные данные на ту же страницу  `editWish.php`  с использованием метода "Request" "POST".
 
+[[_redisplaying_the_due_date_after_an_unsuccessful_submission]]
 === Повторное отображение срока выполнения после неудавшейся отправки
 
-Если пользователь не указал описание в форме "Add Wish", то появится сообщение об ошибке, и будет выполнен возврат к странице  ``editWish.php`` . В случае возврата пользователя к странице  ``editWish.php``  в форме "Add Wish" должно отображаться значение  ``dueDate``  (если оно было до этого введено). В текущей реализации формы оба поля остаются пустыми. Для того чтобы введенные значения остались в полях, необходимо сохранить данные нового пожелания в массиве. Массив будет состоять из дв [...]
+Если пользователь не указал описание в форме "Add Wish", то появится сообщение об ошибке, и будет выполнен возврат к странице  `editWish.php` . В случае возврата пользователя к странице  `editWish.php`  в форме "Add Wish" должно отображаться значение  `dueDate`  (если оно было до этого введено). В текущей реализации формы оба поля остаются пустыми. Для того чтобы введенные значения остались в полях, необходимо сохранить данные нового пожелания в массиве. Массив будет состоять из двух эле [...]
 
-*Примечание.* Код, перезагружающий форму ввода, если описание не введено в <<validateAndEnterWishToDatabase,код, проверяющий данные и вводит их в базу данных>>. Этот код не рассматривается в этом разделе. В соответствии с кодом в этом разделе значение  ``dueDate``  будет отображаться в поле в случае перезагрузки формы.
+*Примечание.* Код, перезагружающий форму ввода, если описание не введено в <<validateAndEnterWishToDatabase,код, проверяющий данные и вводит их в базу данных>>. Этот код не рассматривается в этом разделе. В соответствии с кодом в этом разделе значение  `dueDate`  будет отображаться в поле в случае перезагрузки формы.
 
 *Для обеспечения повторного вывода формы ввода после неудачной отправки формы пользователем необходимо выполнить следующее:*
 
-1. Введите или вставьте следующий блок кода в элемент HTML <body> на странице  ``editWish.php``  непосредственно над формой ввода:
+1. Введите или вставьте следующий блок кода в элемент HTML <body> на странице  `editWish.php`  непосредственно над формой ввода:
 
 [source,php]
 ----
 
-<?php 
-if ($_SERVER["REQUEST_METHOD"] == "POST")$wish = array("description" => $_POST["wish"], "due_date" => $_POST["dueDate"]);else$wish = array("description" => "", "due_date" => "");
-?>  
+<?php
+if ($_SERVER['REQUEST_METHOD'] == "POST")
+    $wish = array("description" => $_POST['wish'],
+                        "due_date" => $_POST['dueDate']);
+else
+    $wish = array("description" => "",
+                        "due_date" => "");
+?>
 ----
 
-В соответствии с кодом определяется тот метод "Request Server", который использовался для передачи данных, а также создается массив с именем $wish. Если использовался метод "POST" (что означает, что входная форма отображается после неудачной попытки сохранить пожелание с пустым описанием), то элементы  ``description``  и  ``due_date``  принимают значения, переданные с использованием метода "POST".
+В соответствии с кодом определяется тот метод "Request Server", который использовался для передачи данных, а также создается массив с именем $wish. Если использовался метод "POST" (что означает, что входная форма отображается после неудачной попытки сохранить пожелание с пустым описанием), то элементы  `description`  и  `due_date`  принимают значения, переданные с использованием метода "POST".
 
-Если использовался другой метод (что означает, что входная форма отображается впервые после переадресации со страницы  ``editWishList.php`` ), то элементы  ``description``  и  ``due_date``  являются пустыми.
+Если использовался другой метод (что означает, что входная форма отображается впервые после переадресации со страницы  `editWishList.php` ), то элементы  `description`  и  `due_date`  являются пустыми.
 
-*Примечание.*В любом случае описание пустое. Единственным отличием является  ``dueDate`` .
+*Примечание.*В любом случае описание пустое. Единственным отличием является  `dueDate` .
 
-2. Обновите форму "Add Wish" таким образом, чтобы значения ее полей ввода были извлечены из массива  ``$wish`` . Замените строки форме "Add Wish":
+2. Обновите форму "Add Wish" таким образом, чтобы значения ее полей ввода были извлечены из массива  `$wish` . Замените строки форме "Add Wish":
 
-[source,java]
+[source,php]
 ----
 
 Describe your wish: <input type="text" name="wish"  value="" /><br/>
@@ -223,13 +225,13 @@ Describe your wish: <input type="text" name="wish"  value="<?php echo $wish['des
 When do you want to get it? <input type="text" name="dueDate" value="<?php echo $wish['due_date']; ?>"/><br/>
 ----
 
-
+[[_verifying_the_wisher_s_logon]]
 == Проверка входа пользователя
 
-В файле  ``editWish.php``  введите следующий код обработки сеанса в блоке <? php ? > в начале файла:
+В файле  `editWish.php`  введите следующий код обработки сеанса в блоке <? php ? > в начале файла:
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
@@ -253,10 +255,10 @@ if (!array_key_exists("user", $_SESSION)) {
 
 После подтверждения пользователем нового пожелания приложение добавляет пожелание к базе данных "Wishes". Для включения этой функциональной возможности вставьте в приложение следующий код:
 
-* Добавьте еще две дополнительных функции к классу  ``WishDB``  в  ``db.php`` .
+* Добавьте еще две дополнительных функции к классу  `WishDB`  в  `db.php` .
 * Первая функция добавляет новую запись в таблицу пожеланий.
 * Вторая функция преобразовывает даты в формат, поддерживаемый сервером баз данных MySQL.
-* Добавьте к  ``editWish.php``  код, который будет использовать новые вспомогательные функции в  ``WishDB``  для ввода нового пожелания в базу данных.
+* Добавьте к  `editWish.php`  код, который будет использовать новые вспомогательные функции в  `WishDB`  для ввода нового пожелания в базу данных.
 
 
 [[add-insert-wish]]
@@ -264,33 +266,40 @@ if (!array_key_exists("user", $_SESSION)) {
 
 Эта функция требует в качестве входных параметров идентификатор пользователя, описание нового пожелания и срок выполнения пожелания, после чего добавляет эти данные к базе данных как новую запись. Функция не возвращает какого-либо значения.
 
-Откройте  ``db.php ``  и добавьте функцию  ``insert_wish``  в класс  ``WishDB`` .
+Откройте  `db.php `  и добавьте функцию  `insert_wish`  в класс  `WishDB` .
 
 *Для базы данных MySQL*
 
 
-[source,java]
+[source,php]
 ----
 
-function insert_wish($wisherID, $description, $duedate){
-    $description = $this->real_escape_string($description);if ($this->format_date_for_sql($duedate)==null){$this->query("INSERT INTO wishes (wisher_id, description)" ." VALUES (" . $wisherID . ", '" . $description . "')");} else$this->query("INSERT INTO wishes (wisher_id, description, due_date)" . " VALUES (" . $wisherID . ", '" . $description . "', " . $this->format_date_for_sql($duedate) . ")");
+function insert_wish($wisherID, $description, $duedate) {
+    $description = $this->real_escape_string($description);
+    if ($this->format_date_for_sql($duedate)==null){
+       $this->query("INSERT INTO wishes (wisher_id, description)" .
+            " VALUES (" . $wisherID . ", '" . $description . "')");
+    } else
+        $this->query("INSERT INTO wishes (wisher_id, description, due_date)" .
+            " VALUES (" . $wisherID . ", '" . $description . "', "
+            . $this->format_date_for_sql($duedate) . ")");
 }
 ----
 
 *Для базы данных Oracle*
 
 
-[source,java]
+[source,php]
 ----
 
 function insert_wish($wisherID, $description, $duedate) {
-  $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))"; 
-  $stid = oci_parse($this->con, $query);
-  oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
-  oci_bind_by_name($stid, ':desc_bv', $description);
-  oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
-  oci_execute($stid);
-  oci_free_statement($stid);
+    $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))";
+    $stid = oci_parse($this->con, $query);
+    oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
+    oci_bind_by_name($stid, ':desc_bv', $description);
+    oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
+    oci_execute($stid);
+    oci_free_statement($stid);
 }
 ----
 
@@ -300,40 +309,47 @@ function insert_wish($wisherID, $description, $duedate) {
 [[add-format-date-for-sql]]
 === Добавление функции format_date_for_sql в класс WishDB
 
-В файле  ``db.php``  добавьте в класс  ``WishDB``  функцию  ``format_date_for_sql`` . Для выполнения функции качестве входного параметра требуется строка, в которой указана дата. Эта функция возвращает дату в формате, который может быть обработан сервером базы данных, или  ``null`` , если входная строка пустая.
+В файле  `db.php`  добавьте в класс  `WishDB`  функцию  `format_date_for_sql` . Для выполнения функции качестве входного параметра требуется строка, в которой указана дата. Эта функция возвращает дату в формате, который может быть обработан сервером базы данных, или  `null` , если входная строка пустая.
 
-*Примечание.* Функция в этом примере использует функцию PHP  ``date_parse`` . Эта функция работает только с англоязычными датами, такими как "December 25, 2010", и только с арабскими цифрами. На профессиональном веб-сайте следует использовать управляющий элемент выбора даты.
+*Примечание.* Функция в этом примере использует функцию PHP  `date_parse` . Эта функция работает только с англоязычными датами, такими как "December 25, 2010", и только с арабскими цифрами. На профессиональном веб-сайте следует использовать управляющий элемент выбора даты.
 
 *Для базы данных MySQL*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){if ($date == "")return null;else {$dateParts = date_parse($date);return $dateParts["year"]*10000 + $dateParts["month"]*100 + $dateParts["day"];}}
+function format_date_for_sql($date) {
+    if ($date == "")
+        return null;
+    else {
+        $dateParts = date_parse($date);
+        return $dateParts["year"] * 10000 + $dateParts["month"] * 100 + $dateParts["day"];
+    }
+}
 ----
 
 *Для базы данных Oracle*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){
+function format_date_for_sql($date) {
     if ($date == "")
         return null;
     else {
         $dateParts = date_parse($date);
-        return $dateParts['year']*10000 + '-' + $dateParts['month']*100 + '-' + $dateParts['day'];
-   }
+        return $dateParts['year'] * 10000 + '-' + $dateParts['month'] * 100 + '-' + $dateParts['day'];
+    }
 }
 ----
 
-При пустой входной строке код возвращает значение "NULL". В противном случае внутренняя функция  ``date_parse``  вызывается с входным параметром  ``$date`` . Функция  ``date_parse``  возвращает массив, состоящий из трех элементов с именами  ``$dateParts["year"]`` ,  ``$dateParts["month"]``  и  ``$dateParts["day"]`` . Окончательная строка вывода создается из элементов массива  ``$dateParts`` .
+При пустой входной строке код возвращает значение "NULL". В противном случае внутренняя функция  `date_parse`  вызывается с входным параметром  `$date` . Функция  `date_parse`  возвращает массив, состоящий из трех элементов с именами  `$dateParts["year"]` ,  `$dateParts["month"]`  и  `$dateParts["day"]` . Окончательная строка вывода создается из элементов массива  `$dateParts` .
 
-*Важно!* Функция  ``date_parse``  распознает только англоязычные даты. Например, она воспринимает и интерпретирует дату "February 2, 2016" но не дату "2 Unora, 2016".
+*Важно!* Функция  `date_parse`  распознает только англоязычные даты. Например, она воспринимает и интерпретирует дату "February 2, 2016" но не дату "2 Unora, 2016".
 
-*Примечание для пользователей базы данных Oracle.* Единственное требование, предъявляемое к формату, состоит в том, что формат даты в операторе  ``return $dateParts...``  должен совпадать с форматом даты в функции SQL  ``to_date``  из запроса  ``insert_wish`` .
+*Примечание для пользователей базы данных Oracle.* Единственное требование, предъявляемое к формату, состоит в том, что формат даты в операторе  `return $dateParts...`  должен совпадать с форматом даты в функции SQL  `to_date`  из запроса  `insert_wish` .
 
 
 [[validateAndEnterWishToDatabase]]
@@ -341,49 +357,48 @@ function format_date_for_sql($date){
 
 На этом этапе, после окончания разработки дополнительных функций, добавьте код для проверки допустимости данных нового пожелания и ввода данных в базу данных при их корректности. Если данные некорректны, то должна быть выполнена перезагрузка формы "Add Wish". Если данные некорректны, поскольку отсутствует описание пожелания, но при этом указан срок выполнения пожелания, введенные данные сохраняются в поле и отображаются в случае перезагрузке формы благодаря <<inputFormAfterunsuccessfulSa [...]
 
-В верхний блок <? php ? > файла  ``editWish.php``  введите ниже кода обработки сеанса следующий код.
+В верхний блок <? php ? > файла  `editWish.php`  введите ниже кода обработки сеанса следующий код.
 
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
-
-    $wishDescriptionIsEmpty = false;
-    if ($_SERVER['REQUEST_METHOD'] == "POST"){
-        if (array_key_exists("back", $_POST)) {
-           header('Location: editWishList.php' ); 
-           exit;
-        } else
-        if ($_POST['wish'] == "") {
-            $wishDescriptionIsEmpty =  true;
-        } 
-		 else {
-           WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
-           header('Location: editWishList.php' );
-           exit;
-        }
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
+
+$wishDescriptionIsEmpty = false;
+if ($_SERVER['REQUEST_METHOD'] == "POST"){
+    if (array_key_exists("back", $_POST)) {
+        header('Location: editWishList.php' ); 
+        exit;
+    } else
+    if ($_POST['wish'] == "") {
+        $wishDescriptionIsEmpty =  true;
+    } else {
+        WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
+        header('Location: editWishList.php' );
+        exit;
     }
-	
+}
+  
 ----
 
 Код выполняет следующие функции:
 
-* активация использования файла  ``db.php`` ;
-* получение или создание экземпляра класса  ``WishDB`` ;
-* извлечение идентификатора пользователя, осуществляющего попытку добавления пожелания путем вызова функции  ``get_wisher_id_by_name`` ;
-* инициализация флага  ``$wishDescriptionIsEmpty`` , который будет использован позже для отображения сообщений об ошибках;
-* проверка того, что используется метод запроса "POST" (соответствует передаче данных из формы для ввода данных пожелания непосредственно на странице  ``editWish.php`` );
-* проверка того, содержит ли массив  ``$_POST``  элемент с ключом "back".
+* активация использования файла  `db.php` ;
+* получение или создание экземпляра класса  `WishDB` ;
+* извлечение идентификатора пользователя, осуществляющего попытку добавления пожелания путем вызова функции  `get_wisher_id_by_name` ;
+* инициализация флага  `$wishDescriptionIsEmpty` , который будет использован позже для отображения сообщений об ошибках;
+* проверка того, что используется метод запроса "POST" (соответствует передаче данных из формы для ввода данных пожелания непосредственно на странице  `editWish.php` );
+* проверка того, содержит ли массив  `$_POST`  элемент с ключом "back".
 
-Если массив  ``$_POST``  содержит элемент с ключом "back", то перед передачей формы была нажата кнопка "Back to the List". В этом случае осуществляется перенаправление на страницу  ``editWishList.php``  без сохранения данных, введенных в полях, и прекращается обработка блока PHP.
+Если массив  `$_POST`  содержит элемент с ключом "back", то перед передачей формы была нажата кнопка "Back to the List". В этом случае осуществляется перенаправление на страницу  `editWishList.php`  без сохранения данных, введенных в полях, и прекращается обработка блока PHP.
 
 Если массив $_POST _не_ содержит элемент с ключом "back", то данные были переданы путем нажатия кнопки "Save Changes". В этом случае в соответствии с кодом выполняется проверка наличия описания пожелания. Это реализуется путем проверки того, является ли элемент с ключом "wish" в массиве "$_POST" пустым. Если ключ пуст, значение флага $wishDescriptionIsEmpty изменяется на "true". Следует отметить, что если выполнение дальнейшего кода в блоке PHP прерывается, форма "Add Wish" перезагружается.
 
-Если не была нажата кнопка "Back to the List", но при этом указано описание пожелания, то код вызывает функцию  ``insert_wish``  с идентификатором пользователя, описанием и сроком выполнения пожелания в качестве входных параметров. Затем код перенаправляет пользователя на страницу  ``editWishList.php``  и прекращает обработку PHP.
-
+Если не была нажата кнопка "Back to the List", но при этом указано описание пожелания, то код вызывает функцию  `insert_wish`  с идентификатором пользователя, описанием и сроком выполнения пожелания в качестве входных параметров. Затем код перенаправляет пользователя на страницу  `editWishList.php`  и прекращает обработку PHP.
 
+[[_displaying_error_messages]]
 === Отображение сообщений об ошибках
 
 При попытке пользователя сохранить пожелание без описания должно отобразиться сообщение об ошибке.
@@ -393,16 +408,19 @@ require_once("Includes/db.php");
 [source,php]
 ----
 
-<?phpif ($wishDescriptionIsEmpty) echo "Please enter description<br/>";?>
+<?php
+if ($wishDescriptionIsEmpty)
+    echo "Please enter description<br/>";
+?>
 ----
 
-Сообщение об ошибке отображается в случае значения "true" для флага  ``$wishDescriptionIsEmpty`` . Флаг обрабатывается в течение проверки допустимости формы ввода.
-
+Сообщение об ошибке отображается в случае значения "true" для флага  `$wishDescriptionIsEmpty` . Флаг обрабатывается в течение проверки допустимости формы ввода.
 
+[[_returning_to_the_front_index_php_page]]
 == Возврат к первой странице "index.php"
 
 Пользователь должен иметь возможность, нажав кнопку, в любой момент вернуться на первую страницу приложения. 
-Для реализации этих функции введите следующую форму ввода HTML в файл  ``editWishList.php``  перед закрывающим тегом </body>:
+Для реализации этих функции введите следующую форму ввода HTML в файл  `editWishList.php`  перед закрывающим тегом </body>:
 
 
 [source,xml]
@@ -411,32 +429,37 @@ require_once("Includes/db.php");
 <form name="backToMainPage" action="index.php"><input type="submit" value="Back To Main Page"/></form>
 ----
 
-Форма перенаправляет пользователя на первую страницу "index.php" после нажатия кнопки "Back to Main Page".
 
+Форма перенаправляет пользователя на первую страницу "index.php" после нажатия кнопки "Back to Main Page".
 
+[[_testing_the_add_wish_functionality]]
 == Тестирование функциональной возможности добавления пожелания
 
-1. Запустите приложение. На странице  ``index.php``  заполните следующие поля: в поле "Username" введите "Tom", в поле "Password" введите "tomcat".
+1. Запустите приложение. На странице  `index.php`  заполните следующие поля: в поле "Username" введите "Tom", в поле "Password" введите "tomcat".
+
 image::images/user-logon-to-edit-wish-list.png[]
-2. Нажмите кнопку "Edit My Wish List". Откроется страница  ``editWishList.php`` . 
+
+2. Нажмите кнопку "Edit My Wish List". Откроется страница  `editWishList.php` . 
 image::images/edit-wish-list-add-wish.png[]
-3. Нажмите кнопку "Back to Main Page". Откроется страница  ``index.php`` .
-4. Войдите в систему под именем "Tom" и снова нажмите кнопку "Edit My Wish List". Откроется страница  ``editWishList.php`` .
-5. Нажмите кнопку "Add Wish". Откроется страница  ``editWish.php`` . Заполните форму.
+3. Нажмите кнопку "Back to Main Page". Откроется страница  `index.php` .
+4. Войдите в систему под именем "Tom" и снова нажмите кнопку "Edit My Wish List". Откроется страница  `editWishList.php` .
+5. Нажмите кнопку "Add Wish". Откроется страница  `editWish.php` . Заполните форму.
+
 image::images/new-wish.png[] 
-Нажмите кнопку "Back to the List". Откроется страница  ``editWishList.php`` , но новое пожелание в списке отсутствует.
-6. Снова нажмите кнопку "Add Wish". Откроется страница  ``editWish.php`` . Укажите срок выполнения пожелания, а поле описания оставьте пустым. Нажмите кнопку "Save Changes". На странице  ``editWish.php``  отображается форма ввода с сообщением об ошибке и заполненным полем срока выполнения пожелания.
-7. Снова нажмите кнопку "Add Wish". Откроется страница  ``editWish.php`` . Заполните форму и нажмите кнопку "Save Changes". На странице  ``editWishList.php``  отображается обновленный список пожеланий. 
-image::images/edit-wish-list-updated.png[]
 
+Нажмите кнопку "Back to the List". Откроется страница  `editWishList.php` , но новое пожелание в списке отсутствует.
+6. Снова нажмите кнопку "Add Wish". Откроется страница  `editWish.php` . Укажите срок выполнения пожелания, а поле описания оставьте пустым. Нажмите кнопку "Save Changes". На странице  `editWish.php`  отображается форма ввода с сообщением об ошибке и заполненным полем срока выполнения пожелания.
+7. Снова нажмите кнопку "Add Wish". Откроется страница  `editWish.php` . Заполните форму и нажмите кнопку "Save Changes". На странице  `editWishList.php`  отображается обновленный список пожеланий. 
+image::images/edit-wish-list-updated.png[]
 
+[[_application_source_code_after_the_current_lesson_is_completed]]
 == Исходный код приложения на момент завершения текущего урока
 
 Для пользователей MySQL: щелкните link:https://netbeans.org/files/documents/4/1932/lesson6.zip[+здесь+] для загрузки исходного кода, отражающего состояние проекта по завершении данного урока.
 
 Для пользователей Oracle Database: щелкните link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson6.zip[+здесь+] для загрузки исходного кода, отражающего состояние проекта по завершении данного урока.
 
-
+[[_next_steps]]
 == Что дальше?
 
 link:wish-list-lesson5.html[+<<Предыдущий урок+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_zh_CN.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_zh_CN.asciidoc
index 091406c..f5ffb92 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_zh_CN.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson6_zh_CN.asciidoc
@@ -43,57 +43,36 @@
 
 
 
-1. link:wish-list-tutorial-main-page.html[+使用 PHP 创建数据库驱动的应用程序 - 主页+]
-2. 
-创建数据库
-
-1. link:wish-list-lesson1.html[+创建 MySQL 数据库+]
-2. link:wish-list-oracle-lesson1.html[+创建 Oracle 数据库表+]
-3. 
-link:wish-list-lesson2.html[+设计应用程序。从数据库读取数据+]
-
-4. link:wish-list-lesson3.html[+创建新的应用程序用户+]
-5. link:wish-list-lesson4.html[+优化代码+]
-6. link:wish-list-lesson5.html[+添加安全功能。实现应用程序用户登录+]
-7. 
-*=> 在数据库中添加新的愿望*
-
-8. link:wish-list-lesson7.html[+更新和删除数据库中的条目+]
-9. link:wish-list-lesson8.html[+使用 CSS 技术改进应用程序的外观+]
-10. link:wish-list-lesson9.html[+将应用程序部署到远程 Web 服务器+]
-
-image::images/netbeans-stamp-80-74-73.png[title="此页上的内容适用于 NetBeans IDE 7.2、7.3、7.4 和 8.0"]
-
 在本课中,将使用以下两个功能扩展应用程序功能:
 
 
-要实现该功能,请编辑  ``editWishList.php``  文件并创建新文件  ``editWish.php`` 。
+要实现该功能,请编辑  `editWishList.php`  文件并创建新文件  `editWish.php` 。
 
 image::images/page-flow-diagram-l6.png[]
 
 当前文档是link:wish-list-tutorial-main-page.html[+在适用于 PHP 的 NetBeans IDE 中创建 CRUD 应用程序+]教程的一部分。
 
 
-
+[[_application_source_code_from_the_previous_lesson]]
 == 来自上一课的应用程序源代码
 
 MySQL 用户:单击link:https://netbeans.org/files/documents/4/1931/lesson5.zip[+此处+]以下载源代码,该代码反映了在完成上一课之后的项目状态。
 
 Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson5.zip[+此处+]以下载源代码,该代码反映了在完成上一课之后的项目状态。
 
-
+[[_submitting_a_new_wish]]
 == 提交新的愿望
 
 用户可使用以下步骤提交新的愿望:
 
-1. 用户进行登录,切换到  ``editWishList.php``  页,然后按 "Add Wish" 按钮。 ``editWish.php``  页打开,并显示 HTML 窗体。
+1. 用户进行登录,切换到  `editWishList.php`  页,然后按 "Add Wish" 按钮。 `editWish.php`  页打开,并显示 HTML 窗体。
 2. 用户在 HTML 窗体中输入愿望说明,可能还会输入他/她希望实现愿望的日期,然后按 "Save Changes" 按钮。
 3. 如果提交窗体而未输入愿望说明,用户将返回到窗体进行重试。如果用户提交了截止日期而没有提供说明,在重新加载窗体时,将重新显示该日期。
 
 要为用户实现此过程,请在应用程序中添加以下功能:
 
-* <<add-wish-ui-elements,用户界面组件>>,包含添加愿望的 HTML 窗体以及  ``editWishList.php `` 中将用户重定向到该窗体的按钮。
-* 在提交不完整的窗体时<<inputFormAfterunsuccessfulSave,重新显示截止日期>>的代码。
+* <<add-wish-ui-elements,用户界面组件>>,包含添加愿望的 HTML 窗体以及  `editWishList.php ` 中将用户重定向到该窗体的按钮。
+* 在提交不完整的窗体时<<_returning_to_the_front_index_php_page,重新显示截止日期>>的代码。
 
 
 [[add-wish-ui-elements]]
@@ -101,7 +80,7 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 
 *添加功能以添加新的愿望:*
 
-1. 实现 "Add Wish" 按钮。在  ``editWishList.php``  文件的 PHP 块下面添加以下 HTML 代码:
+1. 实现 "Add Wish" 按钮。在  `editWishList.php`  文件的 PHP 块下面添加以下 HTML 代码:
 
 [source,xml]
 ----
@@ -109,8 +88,7 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
     <head>
-
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
         <form name="addNewWish" action="editWish.php">            
@@ -122,9 +100,9 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 
 *注:*您可以忽略来自 HTML 验证器的警告。
 
-窗体包含  ``submit``  类型的 "Add Wish" 输入字段。该字段实现 "Add Wish" 按钮。当用户单击 "Add Wish" 时,他们将重定向到  ``editWish.php``  页。由于没有通过该窗体传输任何数据,因此,不会使用服务器请求方法。
+窗体包含  `submit`  类型的 "Add Wish" 输入字段。该字段实现 "Add Wish" 按钮。当用户单击 "Add Wish" 时,他们将重定向到  `editWish.php`  页。由于没有通过该窗体传输任何数据,因此,不会使用服务器请求方法。
 
-2. 在 addNewWish 窗体上面添加一个表以显示许愿者的现有愿望。代码类似于  ``wishlist.php`` 。
+2. 在 addNewWish 窗体上面添加一个表以显示许愿者的现有愿望。代码类似于  `wishlist.php` 。
 
 *对于 MySQL 数据库*:
 
@@ -132,7 +110,20 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 [source,php]
 ----
 
-<table border="black"><tr><th>Item</th><th>Due Date</th></tr><?phprequire_once("Includes/db.php");$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);while($row = mysqli_fetch_array($result)) {echo "<tr><td>" . htmlentities($row['description']) . "</td>";echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";}?></table>
+<table border="black">
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
+    <?php
+    $result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+    while ($row = mysqli_fetch_array($result)) {
+        echo "<tr><td>" . htmlentities($row['description']) . "</td>";
+        echo "<td>" . htmlentities($row['due_date']) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
+</table>
 ----
 
 *对于 Oracle 数据库:*
@@ -142,18 +133,22 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 ----
 
 <table border="black">
-    <tr><th>Item</th><th>Due Date</th></tr>
+    <tr>
+        <th>Item</th>
+        <th>Due Date</th>
+    </tr>
     <?php
-    require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);
     $stid = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
-    while ($row = oci_fetch_array($stid)) {echo "<tr><td>" . htmlentities($row['DESCRIPTION']) . "</td>";echo "<td>" . htmlentities($row['DUE_DATE']) . "</td></tr>\n";
+    while ($row = oci_fetch_array($stid)) {
+        echo "<tr><td>" . htmlentities($row['DESCRIPTION']) . "</td>";
+        echo "<td>" . htmlentities($row['DUE_DATE']) . "</td></tr>\n";
     }
+    oci_free_statement($stid);
     ?>
 </table>
 ----
-3. 在 "Source Files"(源文件)文件夹中创建  ``editWish.php``  PHP 文件。
-4. 在  ``editWish.php``  中,实现 "Add Wish" 窗体。在 <? php ?> 块下键入或粘贴以下代码:
+3. 在 "Source Files"(源文件)文件夹中创建  `editWish.php`  PHP 文件。
+4. 在  `editWish.php`  中,实现 "Add Wish" 窗体。在 <? php ?> 块下键入或粘贴以下代码:
 
 [source,xml]
 ----
@@ -163,10 +158,14 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 <html>
     <head>
 
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
-        <form name="editWish" action="editWish.php" method="POST">Describe your wish: <input type="text" name="wish"  value="" /><br/>When do you want to get it? <input type="text" name="dueDate" value=""/><br/><input type="submit" name="saveWish" value="Save Changes"/><input type="submit" name="back" value="Back to the List"/>
+        <form name="editWish" action="editWish.php" method="POST">
+            Describe your wish: <input type="text" name="wish"  value="" /><br/>
+            When do you want to get it? <input type="text" name="dueDate" value=""/><br/>
+            <input type="submit" name="saveWish" value="Save Changes"/>
+            <input type="submit" name="back" value="Back to the List"/>
         </form>
     </body>
 </html> 
@@ -176,39 +175,44 @@ Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/
 
 * 两个空文本字段,用于输入愿望说明和截止日期。
 * 在输入字段旁边输出的文本。
-* 表示 "Save Changes" 按钮的  ``submit``  字段
-* 表示 "Back to the List" 按钮的  ``submit``  字段,用于返回到  ``editWishList.php``  页
-
-在按 "Add Wish" 按钮后,窗体将通过请求方法 POST 将输入的数据提交到同一页面,即  ``editWish.php`` 。
+* 表示 "Save Changes" 按钮的  `submit`  字段
+* 表示 "Back to the List" 按钮的  `submit`  字段,用于返回到  `editWishList.php`  页
 
+在按 "Add Wish" 按钮后,窗体将通过请求方法 POST 将输入的数据提交到同一页面,即  `editWish.php` 。
 
+[[_redisplaying_the_due_date_after_an_unsuccessful_submission]]
 === 在提交失败后重新显示截止日期
 
-如果用户在 "Add Wish" 窗体中未填写说明,则会显示一条错误消息,并且用户会返回到  ``editWish.php``  页。当用户返回到  ``editWish.php``  时,"Add Wish" 窗体应显示  ``dueDate``  值(如果已输入)。在当前的窗体实现中,这两个字段始终为空。要保留输入的值,您需要将新愿望数据保存到数组中。该数组包含两个名为  ``description``  和  ``due_date``  的元素。然后,您需要更改 "Add Wish" 窗体,使其能够从数组中检索  ``dueDate``  字段值。
+如果用户在 "Add Wish" 窗体中未填写说明,则会显示一条错误消息,并且用户会返回到  `editWish.php`  页。当用户返回到  `editWish.php`  时,"Add Wish" 窗体应显示  `dueDate`  值(如果已输入)。在当前的窗体实现中,这两个字段始终为空。要保留输入的值,您需要将新愿望数据保存到数组中。该数组包含两个名为  `description`  和  `due_date`  的元素。然后,您需要更改 "Add Wish" 窗体,使其能够从数组中检索  `dueDate`  字段值。
 
-*注:*未输入说明时,重新加载输入窗体的代码包含在<<validateAndEnterWishToDatabase,用于验证数据并将其输入到数据库的代码>>中。本部分未介绍该代码。本部分中的代码仅保留  ``dueDate``  值,以便在重新加载窗体时显示该值。
+*注:*未输入说明时,重新加载输入窗体的代码包含在<<_verifying_the_wisher_s_logon,用于验证数据并将其输入到数据库的代码>>中。本部分未介绍该代码。本部分中的代码仅保留  `dueDate`  值,以便在重新加载窗体时显示该值。
 
 *在用户提交输入窗体失败后重新显示该窗体:*
 
-1. 在  ``editWish.php``  的 HTML <body> 元素内,紧靠输入窗体上面键入或粘贴以下代码块:
+1. 在  `editWish.php`  的 HTML <body> 元素内,紧靠输入窗体上面键入或粘贴以下代码块:
 
 [source,php]
 ----
 
-<?php 
-if ($_SERVER["REQUEST_METHOD"] == "POST")$wish = array("description" => $_POST["wish"], "due_date" => $_POST["dueDate"]);else$wish = array("description" => "", "due_date" => "");
-?>  
+<?php
+if ($_SERVER['REQUEST_METHOD'] == "POST")
+    $wish = array("description" => $_POST['wish'],
+                        "due_date" => $_POST['dueDate']);
+else
+    $wish = array("description" => "",
+                        "due_date" => "");
+?>
 ----
 
-该代码检查使用哪个请求服务器方法传输数据,并创建一个名为 $wish 的数组。如果该方法是 POST(表示在尝试保存具有空说明的愿望失败后显示输入窗体),则  ``description``  和  ``due_date``  元素接受通过 POST 传输的值。
+该代码检查使用哪个请求服务器方法传输数据,并创建一个名为 $wish 的数组。如果该方法是 POST(表示在尝试保存具有空说明的愿望失败后显示输入窗体),则  `description`  和  `due_date`  元素接受通过 POST 传输的值。
 
-如果该方法不是 POST(表示在重定向窗体后第一次显示输入窗体),则  ``editWishList.php``  页以及  ``description``  和  ``due_date``  元素均为空。
+如果该方法不是 POST(表示在重定向窗体后第一次显示输入窗体),则  `editWishList.php`  页以及  `description`  和  `due_date`  元素均为空。
 
-*注:*在这两种情况下,说明均为空。唯一的区别是  ``dueDate`` 。
+*注:*在这两种情况下,说明均为空。唯一的区别是  `dueDate` 。
 
-2. 更新 "Add Wish" 窗体,以便从  ``$wish``  数组中检索其输入字段的值。将 "Add Wish" 窗体中的行:
+2. 更新 "Add Wish" 窗体,以便从  `$wish`  数组中检索其输入字段的值。将 "Add Wish" 窗体中的行:
 
-[source,java]
+[source,php]
 ----
 
 Describe your wish: <input type="text" name="wish"  value="" /><br/>
@@ -223,13 +227,13 @@ Describe your wish: <input type="text" name="wish"  value="<?php echo $wish['des
 When do you want to get it? <input type="text" name="dueDate" value="<?php echo $wish['due_date']; ?>"/><br/>
 ----
 
-
+[[_verifying_the_wisher_s_logon]]
 == 验证许愿者的登录
 
-在  ``editWish.php``  文件中,在文件顶部的 <? php ?> 块中输入以下会话处理代码:
+在  `editWish.php`  文件中,在文件顶部的 <? php ?> 块中输入以下会话处理代码:
 
 
-[source,java]
+[source,php]
 ----
 
 session_start();
@@ -253,10 +257,10 @@ if (!array_key_exists("user", $_SESSION)) {
 
 在用户提交新的愿望后,应用程序需要将愿望添加到“愿望”数据库中。要实现该功能,请在应用程序中添加以下代码:
 
-* 向  ``db.php``  的  ``WishDB``  类中添加另外两个辅助函数。
+* 向  `db.php`  的  `WishDB`  类中添加另外两个辅助函数。
 * 一个函数将新记录添加到 wishes 表中。
 * 另一个函数将日期转换为 MySQL 数据库服务器支持的格式。
-* 在  ``editWish.php``  中添加代码,以使用  ``WishDB``  中的新辅助函数在数据库中输入新的愿望。
+* 在  `editWish.php`  中添加代码,以使用  `WishDB`  中的新辅助函数在数据库中输入新的愿望。
 
 
 [[add-insert-wish]]
@@ -264,33 +268,40 @@ if (!array_key_exists("user", $_SESSION)) {
 
 该函数要求将许愿者 ID、新愿望说明和愿望截止日期作为输入参数,并在数据库的新记录中输入该数据。该函数不会返回任何值。
 
-打开  ``db.php ``  并将  ``insert_wish``  函数添加到  ``WishDB``  类中:
+打开  `db.php `  并将  `insert_wish`  函数添加到  `WishDB`  类中:
 
 *对于 MySQL 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
-function insert_wish($wisherID, $description, $duedate){
-    $description = $this->real_escape_string($description);if ($this->format_date_for_sql($duedate)==null){$this->query("INSERT INTO wishes (wisher_id, description)" ." VALUES (" . $wisherID . ", '" . $description . "')");} else$this->query("INSERT INTO wishes (wisher_id, description, due_date)" . " VALUES (" . $wisherID . ", '" . $description . "', " . $this->format_date_for_sql($duedate) . ")");
+function insert_wish($wisherID, $description, $duedate) {
+    $description = $this->real_escape_string($description);
+    if ($this->format_date_for_sql($duedate)==null){
+       $this->query("INSERT INTO wishes (wisher_id, description)" .
+            " VALUES (" . $wisherID . ", '" . $description . "')");
+    } else
+        $this->query("INSERT INTO wishes (wisher_id, description, due_date)" .
+            " VALUES (" . $wisherID . ", '" . $description . "', "
+            . $this->format_date_for_sql($duedate) . ")");
 }
 ----
 
 *对于 Oracle 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
 function insert_wish($wisherID, $description, $duedate) {
-  $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))"; 
-  $stid = oci_parse($this->con, $query);
-  oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
-  oci_bind_by_name($stid, ':desc_bv', $description);
-  oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
-  oci_execute($stid);
-  oci_free_statement($stid);
+    $query = "INSERT INTO wishes (wisher_id, description, due_date) VALUES (:wisher_id_bv, :desc_bv, to_date(:due_date_bv, 'YYYY-MM-DD'))";
+    $stid = oci_parse($this->con, $query);
+    oci_bind_by_name($stid, ':wisher_id_bv', $wisherID);
+    oci_bind_by_name($stid, ':desc_bv', $description);
+    oci_bind_by_name($stid, ':due_date_bv', $this->format_date_for_sql($duedate));
+    oci_execute($stid);
+    oci_free_statement($stid);
 }
 ----
 
@@ -300,90 +311,95 @@ function insert_wish($wisherID, $description, $duedate) {
 [[add-format-date-for-sql]]
 === 将 format_date_for_sql 函数添加到 WishDB 中
 
-将  ``format_date_for_sql``  函数添加到  ``db.php``  的  ``WishDB``  类中。该函数需要一个字符串,并将日期作为输入参数。该函数返回具有数据库服务器可处理的格式的日期;如果输入字符串为空,则返回 ``空值`` 。
+将  `format_date_for_sql`  函数添加到  `db.php`  的  `WishDB`  类中。该函数需要一个字符串,并将日期作为输入参数。该函数返回具有数据库服务器可处理的格式的日期;如果输入字符串为空,则返回 `空值` 。
 
-*注:*本示例中的函数使用 PHP  ``date_parse``  函数。该函数仅适用于英语语言的日期(如 December 25, 2010)和阿拉伯数字。专业 Web 站点使用日期选取器。
+*注:*本示例中的函数使用 PHP  `date_parse`  函数。该函数仅适用于英语语言的日期(如 December 25, 2010)和阿拉伯数字。专业 Web 站点使用日期选取器。
 
 *对于 MySQL 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){if ($date == "")return null;else {$dateParts = date_parse($date);return $dateParts["year"]*10000 + $dateParts["month"]*100 + $dateParts["day"];}}
-----
+function format_date_for_sql($date) {
+    if ($date == "")
+        return null;
+    else {
+        $dateParts = date_parse($date);
+        return $dateParts["year"] * 10000 + $dateParts["month"] * 100 + $dateParts["day"];
+    }
+}
 
 *对于 Oracle 数据库:*
 
 
-[source,java]
+[source,php]
 ----
 
-function format_date_for_sql($date){
+function format_date_for_sql($date) {
     if ($date == "")
         return null;
     else {
         $dateParts = date_parse($date);
-        return $dateParts['year']*10000 + '-' + $dateParts['month']*100 + '-' + $dateParts['day'];
-   }
+        return $dateParts['year'] * 10000 + '-' + $dateParts['month'] * 100 + '-' + $dateParts['day'];
+    }
 }
 ----
 
-如果输入字符串为空,则代码返回空值。否则,将  ``$date``  作为输入参数以调用内部  ``date_parse``  函数。 ``date_parse``  函数返回一个数组,其中包含三个名为  ``$dateParts["year"]`` 、 ``$dateParts["month"]``  和  ``$dateParts["day"]``  的元素。最终输出字符串由  ``$dateParts``  数组元素组成。
+如果输入字符串为空,则代码返回空值。否则,将  `$date`  作为输入参数以调用内部  `date_parse`  函数。 `date_parse`  函数返回一个数组,其中包含三个名为  `$dateParts["year"]` 、 `$dateParts["month"]`  和  `$dateParts["day"]`  的元素。最终输出字符串由  `$dateParts`  数组元素组成。
 
-*重要说明:* ``date_parse``  函数仅识别英语日期。例如,它解析 "February 2, 2016" 而不解析 "2 Unora, 2016"。
+*重要说明:* `date_parse`  函数仅识别英语日期。例如,它解析 "February 2, 2016" 而不解析 "2 Unora, 2016"。
 
-*Oracle 数据库用户注意事项:*唯一的格式要求是, ``return $dateParts...``  语句中的日期格式应与  ``insert_wish``  查询的  ``to_date``  SQL 函数中的日期格式相匹配。
+*Oracle 数据库用户注意事项:*唯一的格式要求是, `return $dateParts...`  语句中的日期格式应与  `insert_wish`  查询的  `to_date`  SQL 函数中的日期格式相匹配。
 
 
 [[validateAndEnterWishToDatabase]]
 === 在数据库中输入新的愿望记录
 
-现在,您已开发了辅助函数,接下来便可添加代码以验证新的愿望数据;如果数据有效,则将数据输入到数据库中。如果数据无效,代码必须重新加载 "Add Wish" 窗体。如果数据无效的原因是没有输入说明,但输入了截止日期,则会保存截止日期并在重新加载窗体时重新显示该日期,您<<inputFormAfterunsuccessfulSave,以前开发的>>代码实现了该功能。
+现在,您已开发了辅助函数,接下来便可添加代码以验证新的愿望数据;如果数据有效,则将数据输入到数据库中。如果数据无效,代码必须重新加载 "Add Wish" 窗体。如果数据无效的原因是没有输入说明,但输入了截止日期,则会保存截止日期并在重新加载窗体时重新显示该日期,您<<_returning_to_the_front_index_php_page,以前开发的>>代码实现了该功能。
 
-在顶部 <? php?> 块(属于  ``editWish.php`` )中会话处理代码下面输入以下代码:
+在顶部 <? php?> 块(属于  `editWish.php` )中会话处理代码下面输入以下代码:
 
 
-[source,java]
+[source,php]
 ----
 
 require_once("Includes/db.php");
-    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
-
-    $wishDescriptionIsEmpty = false;
-    if ($_SERVER['REQUEST_METHOD'] == "POST"){
-        if (array_key_exists("back", $_POST)) {
-           header('Location: editWishList.php' ); 
-           exit;
-        } else
-        if ($_POST['wish'] == "") {
-            $wishDescriptionIsEmpty =  true;
-        } 
-		 else {
-           WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
-           header('Location: editWishList.php' );
-           exit;
-        }
+$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION['user']);
+
+$wishDescriptionIsEmpty = false;
+if ($_SERVER['REQUEST_METHOD'] == "POST"){
+    if (array_key_exists("back", $_POST)) {
+        header('Location: editWishList.php' ); 
+        exit;
+    } else
+    if ($_POST['wish'] == "") {
+        $wishDescriptionIsEmpty =  true;
+    } else {
+        WishDB::getInstance()->insert_wish($wisherID, $_POST['wish'], $_POST['dueDate']);
+        header('Location: editWishList.php' );
+        exit;
     }
-	
+}
+  
 ----
 
 该代码执行以下功能:
 
-* 允许使用  ``db.php``  文件
-* 获取或创建  ``WishDB``  类实例
-* 通过调用  ``get_wisher_id_by_name``  函数,检索尝试添加愿望的许愿者的 ID
-* 初始化  ``$wishDescriptionIsEmpty``  标志,该标志将在以后显示错误消息时使用。
-* 检查请求方法是否为 POST,这意味着数据是从窗体中提交的,目的是在  ``editWish.php``  页中输入愿望数据。
-* 检查  ``$_POST``  数组是否包含具有 "back" 键的元素
+* 允许使用  `db.php`  文件
+* 获取或创建  `WishDB`  类实例
+* 通过调用  `get_wisher_id_by_name`  函数,检索尝试添加愿望的许愿者的 ID
+* 初始化  `$wishDescriptionIsEmpty`  标志,该标志将在以后显示错误消息时使用。
+* 检查请求方法是否为 POST,这意味着数据是从窗体中提交的,目的是在  `editWish.php`  页中输入愿望数据。
+* 检查  `$_POST`  数组是否包含具有 "back" 键的元素
 
-如果  ``$_POST``  数组包含具有 "back" 键的元素,则在提交窗体之前按了 "Back to the List" 按钮。在这种情况下,代码会将用户重定向到  ``editWishList.php`` ,而不保存在字段中输入的任何数据并停止 PHP 处理。
+如果  `$_POST`  数组包含具有 "back" 键的元素,则在提交窗体之前按了 "Back to the List" 按钮。在这种情况下,代码会将用户重定向到  `editWishList.php` ,而不保存在字段中输入的任何数据并停止 PHP 处理。
 
 如果 $_POST 数组_不_包含具有 "back" 键的元素,则数据是通过按 "Save Changes" 按钮提交的。在这种情况下,代码验证是否填写了愿望说明。该代码的工作方式是,检查 $_POST 数组中具有 "wish" 键的元素是否为空;如果该键为空,则将 $wishDescriptionIsEmpty 标志更改为 true。请注意,不会在 PHP 块中执行其他代码,将重新加载 "Add Wish" 窗体。
 
-如果未按 "Back to the List" 按钮但填写了愿望说明,代码将调用  ``insert_wish``  函数并将许愿者 ID、说明和愿望截止日期作为输入参数。然后,代码将用户重定向到  ``editWishList.php``  页并停止 PHP 处理。
-
+如果未按 "Back to the List" 按钮但填写了愿望说明,代码将调用  `insert_wish`  函数并将许愿者 ID、说明和愿望截止日期作为输入参数。然后,代码将用户重定向到  `editWishList.php`  页并停止 PHP 处理。
 
+[[_displaying_error_messages]]
 === 显示错误消息
 
 如果用户尝试保存愿望,但没有输入愿望说明,则一定会显示错误消息。
@@ -393,16 +409,19 @@ require_once("Includes/db.php");
 [source,php]
 ----
 
-<?phpif ($wishDescriptionIsEmpty) echo "Please enter description<br/>";?>
+<?php
+if ($wishDescriptionIsEmpty)
+    echo "Please enter description<br/>";
+?>
 ----
 
-如果  ``$wishDescriptionIsEmpty``  标志为 true,则会显示错误消息。该标志是在输入窗体验证期间处理的。
-
+如果  `$wishDescriptionIsEmpty`  标志为 true,则会显示错误消息。该标志是在输入窗体验证期间处理的。
 
+[[_returning_to_the_front_index_php_page]]
 == 返回到主页 index.php
 
 用户应该能够随时按某个按钮返回到应用程序主页。
-要实现该功能,请在  ``editWishList.php``  文件中的结束 </body> 标记前面输入以下 HTML 输入窗体:
+要实现该功能,请在  `editWishList.php`  文件中的结束 </body> 标记前面输入以下 HTML 输入窗体:
 
 
 [source,xml]
@@ -413,30 +432,33 @@ require_once("Includes/db.php");
 
 一按下 "Back to Main Page" 按钮,该窗体便将用户重定向到主页 index.php。
 
-
+[[_testing_the_add_wish_functionality]]
 == 测试添加愿望功能
 
-1. 运行应用程序。在  ``index.php``  页上,填写以下字段:在 "Username" 字段中输入 "Tom",在 "Password" 字段中输入 "tomcat"。
+1. 运行应用程序。在  `index.php`  页上,填写以下字段:在 "Username" 字段中输入 "Tom",在 "Password" 字段中输入 "tomcat"。
 image::images/user-logon-to-edit-wish-list.png[]
-2. 按 "Edit My Wish List" 按钮。 ``editWishList.php``  页打开。 
+2. 按 "Edit My Wish List" 按钮。 `editWishList.php`  页打开。 
+
 image::images/edit-wish-list-add-wish.png[]
-3. 按 "Back to Main Page" 按钮。 ``index.php``  页打开。
-4. 以 Tom 身份登录,然后再次按 "Edit My Wish List" 按钮。 ``editWishList.php``  页打开。
-5. 按 "Add Wish" 按钮。 ``editWish.php``  页打开。填写窗体。
+
+3. 按 "Back to Main Page" 按钮。 `index.php`  页打开。
+4. 以 Tom 身份登录,然后再次按 "Edit My Wish List" 按钮。 `editWishList.php`  页打开。
+5. 按 "Add Wish" 按钮。 `editWish.php`  页打开。填写窗体。
 image::images/new-wish.png[] 
-按 "Back to the List" 按钮。 ``editWishList.php``  页打开,但未添加输入的愿望。
-6. 再次按 "Add Wish" 按钮。 ``editWish.php``  页打开。填写截止日期并将说明保留空白。按 "Save Changes" 按钮。 ``editWish.php``  页将显示输入窗体,其中包含一条错误消息和填写的截止日期。
-7. 再次按 "Add Wish" 按钮。 ``editWish.php``  页打开。填写窗体,然后按 "Save Changes" 按钮。 ``editWishList.php``  页将显示更新的愿望列表。 
-image::images/edit-wish-list-updated.png[]
+按 "Back to the List" 按钮。 `editWishList.php`  页打开,但未添加输入的愿望。
+6. 再次按 "Add Wish" 按钮。 `editWish.php`  页打开。填写截止日期并将说明保留空白。按 "Save Changes" 按钮。 `editWish.php`  页将显示输入窗体,其中包含一条错误消息和填写的截止日期。
+7. 再次按 "Add Wish" 按钮。 `editWish.php`  页打开。填写窗体,然后按 "Save Changes" 按钮。 `editWishList.php`  页将显示更新的愿望列表。 
 
+image::images/edit-wish-list-updated.png[]
 
+[[_application_source_code_after_the_current_lesson_is_completed]]
 == 完成当前课程后的应用程序源代码
 
 MySQL 用户:单击link:https://netbeans.org/files/documents/4/1932/lesson6.zip[+此处+]以下载源代码,该代码反映了在完成课程后的项目状态。
 
 Oracle 数据库用户:单击link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson6.zip[+此处+]以下载源代码,该代码反映了在完成课程后的项目状态。
 
-
+[[_next_steps]]
 == 后续步骤
 
 link:wish-list-lesson5.html[+<< 上一课+]
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson7.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson7.asciidoc
index 7020637..05b3174 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson7.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson7.asciidoc
@@ -40,142 +40,133 @@
 :description: Lesson 7: Updating and Deleting Entries in the Database - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, Lesson 7: Updating and Deleting Entries in the Database
 
-
-Tutorial contents:
-
-1. link:wish-list-tutorial-main-page.html[+Creating a Database Driven Application With PHP - Main page+]
-2. 
-Creating the Database
-
-1. link:wish-list-lesson1.html[+Creating a MySQL Database+]
-2. link:wish-list-oracle-lesson1.html[+Creating Oracle Database Tables+]
-3. 
-link:wish-list-lesson2.html[+Designing the Application. Reading from the Database+]
-
-4. link:wish-list-lesson3.html[+Creating a New Application User +]
-5. link:wish-list-lesson4.html[+Optimizing the Code+]
-6. link:wish-list-lesson5.html[+Adding Security. Implementing Application User Logon+]
-7. link:wish-list-lesson6.html[+ Adding a New Wish to the Database+]
-8. 
-*=> Updating and Deleting Entries in the Database*
-
-* <<previousLessonSourceCode,Application Source Code from the Previous Lesson>>
-* <<editWish,Editing a Wish>>
-* <<addEditButton,Implementing the Edit Button>>
-* <<wishArrayUpdate,Expanding the $wish Array >>
-* <<updateInputForm,Updating the HTML Input Form>>
-* <<updateWishRecord,Updating the Wish in the Database>>
-* <<testingEditWishFunctionality,Testing the Edit Wish Functionality>>
-* <<deleteWish,Deleting a Wish>>
-* <<testingDeleteWishFunctionality,Testing the Delete Wish Functionality>>
-* <<lessonResultSourceCode,Application Source Code After the Current Lesson Is Completed>>
-* <<nextSteps,Next Steps>>
-9. link:wish-list-lesson8.html[+Making the Application Look Better Using the CSS Technology+]
-10. link:wish-list-lesson9.html[+Deploying the Application on a Remote Web Server+]
-
 In this lesson you will expand the application's functionality with two features:
 
-* <<editWish,Editing a wish>>
-* <<deleteWish,Deleting a wish>>
+* <<_editing_a_wish,Editing a wish>>
+* <<_deleting_a_wish,Deleting a wish>>
 
-To implement these features, you edit the  ``editWishList.php``  and  ``editWish.php``  files. You also create a new file named  ``deleteWish.php`` .
+To implement these features, you edit the  `editWishList.php`  and  `editWish.php`  files. You also create a new file named  `deleteWish.php` .
 
 image::images/page-flow-diagram-l7.png[]
 
 The current document is a part of the Creating a CRUD Application in the NetBeans IDE for PHP tutorial.
 
 
-
 == Application Source Code from the Previous Lesson
 
 MySQL users: Click link:https://netbeans.org/files/documents/4/1932/lesson6.zip[+here+] to download the source code that reflects the project state after the previous lesson is completed.
 
-Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson6.zip[+ here+] to download the source code that reflects the project state after the previous lesson is completed.
+Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson6.zip[+here+] to download the source code that reflects the project state after the previous lesson is completed.
 
 
 == Editing a Wish
 
 The functionality supports the following use case:
 
-* On the  ``editWishList.php``  page, the user presses the Edit button to the right of a wish. The  ``editWish.php``  page with the data of the selected wish opens.
+* On the  `editWishList.php`  page, the user presses the Edit button to the right of a wish. The  `editWish.php`  page with the data of the selected wish opens.
 * The user changes the description and/or the due date of the wish and presses the Save Changes button.
-* If the description is _not_ filled in, an error message is displayed and the user returns to the  ``editWish.php``  page.
-* If the description is filled in, the application returns to the  ``editWishList.php``  page, where the wish is updated.
+* If the description is _not_ filled in, an error message is displayed and the user returns to the  `editWish.php`  page.
+* If the description is filled in, the application returns to the  `editWishList.php`  page, where the wish is updated.
 
 The implementation consists of the following steps:
 
-* <<addEditButton,Adding an Edit button on the editWishList page>>
-* <<wishArrayUpdate,On the editWish.php page, updating the array $wish for storing wish data>>
-* <<updateInputForm,Updating the input form on the editWish.php page>>
-* <<updateWishRecord,Validation of the submitted data and updating the wish in the database>>
+* <<_implementing_the_edit_button,Adding an Edit button on the editWishList page>>
+* <<_expanding_the_code_wish_code_array,On the editWish.php page, updating the array $wish for storing wish data>>
+* <<_updating_the_html_input_form,Updating the input form on the editWish.php page>>
+* <<_updating_the_wish_in_the_database,Validation of the submitted data and updating the wish in the database>>
 
 
 === Implementing the Edit Button
 
-In  ``editWishList.php`` , a table with the wishes of a wisher is implemented by a loop (a  ``while `` statement) that displays rows with wishes while the wishes are selected from the database. Add an Edit button as the extreme right cell in a row.
+In  `editWishList.php` , a table with the wishes of a wisher is implemented by a loop (a  `while ` statement) that displays rows with wishes while the wishes are selected from the database. Add an Edit button as the extreme right cell in a row.
 
-1. To transfer the ID of a wish through the HTML input form, store it in a variable. Enter the following code line at the end of the  ``while `` loop:
+1. To transfer the ID of a wish through the HTML input form, store it in a variable. Enter the following code line at the end of the  `while ` loop:
 
-[source,java]
+[source,php]
 ----
-
-while ($row = ...) {echo ...echo ...*$wishID = $row["id"];*}
-?>
+while ($row = mysqli_fetch_array($result)):
+    echo "<tr><td>" . htmlentities($row['description']) . "</td>";
+    echo "<td>" . htmlentities($row['due_date']) . "</td>";
+    $wishID = $row['id'];
+    echo "<td>WishID=" . $wishID . "</td>";
+    //The loop is left open
+    ?>
 ----
-2. Implement the edit button. Add another table cell before the closing </table> tag, with the editWish form. This form contains a button component and a hidden component that sends the value of  ``$wishID``  when the button is clicked. (Code for the MySQL database is shown, but the added code is the same and in the same location for Oracle Database.)
+2. Implement the edit button. Add another table cell before the closing </table> tag, with the editWish form. This form contains a button component and a hidden component that sends the value of  `$wishID`  when the button is clicked. (Code for the MySQL database is shown, but the added code is the same and in the same location for Oracle Database.)
 
 [source,php]
 ----
 
-   Hello <?php echo $_SESSION["user"]; ?><br/><table border="black"><tr><th>Item</th><th>Due Date</th></tr><?phprequire_once("Includes/db.php");$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);while ($row = mysqli_fetch_array($result)) {echo "<tr><td>" . htmlentities($row["description"]) . "</td>";echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";}mysqli_free_result($result);?>
-            *<td>
-                <form name="editWish" action="editWish.php" method="GET">
-                    <input type="hidden" name="wishID" value="<?php echo  ``$wish`` ID; ?>">
-                    <input type="submit" name="editWish" value="Edit">
-                    </form>
-            </td>*</table>
+Hello <?php echo $_SESSION["user"]; ?><br/>
+<table border="black">
+    <tr><th>Item</th><th>Due Date</th></tr>
+    <?php
+    require_once("Includes/db.php");
+    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);
+    $result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+    while ($row = mysqli_fetch_array($result)) {
+        echo "<tr><td>" . htmlentities($row["description"]) . "</td>";
+        echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
+    <td>
+        <form name="editWish" action="editWish.php" method="GET">
+            <input type="hidden" name="wishID" value="<?php echo $wishID; ?>">
+            <input type="submit" name="editWish" value="Edit">
+        </form>
+    </td>
+</table>
 ----
-3. Change the  ``while``  loop to use link:http://www.php.net/manual/en/control-structures.alternative-syntax.php[+alternative syntax+]. This makes it easy to execute HTML blocks inside the  ``while``  loop. In the alternative  ``while``  loop syntax, the opening curly bracket { is replaced by a colon :, and the ending curly bracket } is replaced by the statement  ``endwhile;`` . Replace the opening curly bracket with a colon, delete the closing curly bracket, and add a new PHP block bef [...]
+3. Change the  `while`  loop to use link:http://www.php.net/manual/en/control-structures.alternative-syntax.php[+alternative syntax+]. This makes it easy to execute HTML blocks inside the  `while`  loop. In the alternative  `while`  loop syntax, the opening curly bracket { is replaced by a colon :, and the ending curly bracket } is replaced by the statement  `endwhile;` . Replace the opening curly bracket with a colon, delete the closing curly bracket, and add a new PHP block before the  [...]
 
 [source,php]
 ----
 
-    while ($row = mysqli_fetch_array($result))[.line-through]#{#*:*echo "<tr><td>" . htmlentities($row["description"]) . "</td>";echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";[.line-through]#    }mysqli_free_result($result);#?>
+   while ($row = mysqli_fetch_array($result)){:
+        echo "<tr><td>" . htmlentities($row["description"]) . "</td>";
+        echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
     <td>
         <form name="editWish" action="editWish.php" method="GET">
-           <input type="hidden" name="wishID" value="<?php echo  ``$wish`` ID; ?>">
+           <input type="hidden" name="wishID" value="<?php echo $wishID; ?>">
            <input type="submit" name="editWish" value="Edit">
         </form>
     </td>
-*    <?php
+    <?php
     endwhile;
     mysqli_free_result($result);
-    ?>*
+    ?>
 </table>
 ----
 4. 
-Fix the table row syntax. Move the row-closing </tr>\n characters from the due date echo statement to a new echo statement just above the  ``endwhile;`` .
+Fix the table row syntax. Move the row-closing </tr>\n characters from the due date echo statement to a new echo statement just above the  `endwhile;` .
 
 
 [source,php]
 ----
 
-    while ($row = mysqli_fetch_array($result))*:*echo "<tr><td>" . htmlentities($row["description"]) . "</td>";echo "<td>" . htmlentities($row["due_date"]) . "</td>[.line-through]#</tr>\n#";?>
+    while ($row = mysqli_fetch_array($result)):
+        echo "<tr><td>" . htmlentities($row["description"]) . "</td>";
+        echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";
+    ?>
     <td>
         <form name="editWish" action="editWish.php" method="GET">
-           <input type="hidden" name="wishID" value="<?php echo  ``$wish`` ID; ?>">
+           <input type="hidden" name="wishID" value="<?php echo $wishID; ?>">
            <input type="submit" name="editWish" value="Edit">
         </form>
     </td>
     <?php
-    *echo "</tr>\n";*
+    echo "</tr>\n";
     endwhile;
     mysqli_free_result($result);
     ?>
 </table>
 ----
 5. 
-The entire table, including the form with the Edit button inside the  ``while `` loop, now looks like this:
+The entire table, including the form with the Edit button inside the  `while ` loop, now looks like this:
 
 *For the MySQL database:*
 
@@ -245,14 +236,13 @@ The entire table, including the form with the Edit button inside the  ``while ``
 </table>
 ----
 
+=== Expanding the  `$wish`  Array
 
-=== Expanding the  ``$wish``  Array
+Upon pressing the Edit button on the  `editWishList.php`  page, the ID of the selected wish is transferred to the  `editWish.php`  page through the Server Request method GET. To store the id of the wish, you need to add a new element to the  `$wish`  array.
 
-Upon pressing the Edit button on the  ``editWishList.php``  page, the ID of the selected wish is transferred to the  ``editWish.php``  page through the Server Request method GET. To store the id of the wish, you need to add a new element to the  ``$wish``  array.
+As when adding a new wish, the input form can be accessed both from the  `editWishList.php`  page and from the  `editWish.php`  page after an unsuccessful attempt to save. The cases are distinguished by the Server Request method through which the data is transferred. GET indicates that the form is displayed when the user first gets to the page by pressing Edit Wish. POST indicates that the user is redirected to the form after attempting to save a wish without a description.
 
-As when adding a new wish, the input form can be accessed both from the  ``editWishList.php``  page and from the  ``editWish.php``  page after an unsuccessful attempt to save. The cases are distinguished by the Server Request method through which the data is transferred. GET indicates that the form is displayed when the user first gets to the page by pressing Edit Wish. POST indicates that the user is redirected to the form after attempting to save a wish without a description.
-
-In  ``editWish.php`` , replace the PHP block in the HTML <body> above the  ``EditWish``  input form with expanded code for the  ``$wish``  array.
+In  `editWish.php` , replace the PHP block in the HTML <body> above the  `EditWish`  input form with expanded code for the  `$wish`  array.
 
 *For the MySQL database:*
 
@@ -260,8 +250,15 @@ In  ``editWish.php`` , replace the PHP block in the HTML <body> above the  ``Edi
 [source,php]
 ----
 
-<?phpif ($_SERVER["REQUEST_METHOD"] == "POST")$wish = array("id" => $_POST["wishID"], "description" => 
-        $_POST["wish"], "due_date" => $_POST["dueDate"]);else if (array_key_exists("wishID", $_GET))$wish = mysqli_fetch_array(WishDB::getInstance()->get_wish_by_wish_id($_GET["wishID"]));else$wish = array("id" => "", "description" => "", "due_date" => "");?>
+<?php
+if ($_SERVER["REQUEST_METHOD"] == "POST")
+    $wish = array("id" => $_POST["wishID"], "description" => 
+            $_POST["wish"], "due_date" => $_POST["dueDate"]);
+else if (array_key_exists("wishID", $_GET))
+    $wish = mysqli_fetch_array(WishDB::getInstance()->get_wish_by_wish_id($_GET["wishID"]));
+else
+    $wish = array("id" => "", "description" => "", "due_date" => "");
+?>
 ----
 
 *For the Oracle database:*
@@ -273,7 +270,7 @@ In  ``editWish.php`` , replace the PHP block in the HTML <body> above the  ``Edi
 <?php
 if ($_SERVER["REQUEST_METHOD"] == "POST")
     $wish = array("id" => $_POST["wishID"], "description" =>
-            $_POST["wish"], "due_date" => $_POST["dueDate"]);
+                $_POST["wish"], "due_date" => $_POST["dueDate"]);
 else if (array_key_exists("wishID", $_GET)) {
     $stid = WishDB::getInstance()->get_wish_by_wish_id($_GET["wishID"]);
     $row = oci_fetch_array($stid, OCI_ASSOC);
@@ -281,23 +278,23 @@ else if (array_key_exists("wishID", $_GET)) {
                 $row["DESCRIPTION"], "due_date" => $row["DUE_DATE"]);
     oci_free_statement($stid);
 } else
-$wish = array("id" => "", "description" => "", "due_date" => "");
+    $wish = array("id" => "", "description" => "", "due_date" => "");
 ?>
 ----
 
-The code initializes the  ``$wish``  array with three elements:  ``id`` ,  ``description`` , and  ``due_date`` . The values of these elements depend on the Server Request method. If the Server Request method is POST, the values are received from the input form. Otherwise, if the Server Request method is GET and the $_GET array contains an element with the key "wishID", the values are retrieved from the database by the function get_wish_by_wish_id. Finally, if the Server Request method is [...]
+The code initializes the  `$wish`  array with three elements:  `id` ,  `description` , and  `due_date` . The values of these elements depend on the Server Request method. If the Server Request method is POST, the values are received from the input form. Otherwise, if the Server Request method is GET and the $_GET array contains an element with the key "wishID", the values are retrieved from the database by the function get_wish_by_wish_id. Finally, if the Server Request method is neither [...]
 
 The preceding code covers the cases for creation and editing wishes. Now you need to update the input form so that it can be also used for both cases.
 
 
 === Updating the HTML Input Form
 
-Currently the input form works when you want to create a new wish and there is no wish id. For the form to work when you want to edit an existing wish, you need to add a hidden field for transferring the ID of a wish. The value of the hidden field must be retrieved from the $wish array. The value must be an empty string during the creation of a new wish. If the wish is edited, the value of the hidden field must change to the ID of the wish. To create this hidden field, add the following  [...]
+Currently the input form works when you want to create a new wish and there is no wish id. For the form to work when you want to edit an existing wish, you need to add a hidden field for transferring the ID of a wish. The value of the hidden field must be retrieved from the $wish array. The value must be an empty string during the creation of a new wish. If the wish is edited, the value of the hidden field must change to the ID of the wish. To create this hidden field, add the following  [...]
 
 [source,php]
 ----
 
-<input type="hidden" name="wishID" value="<?php echo  ``$wish`` ["id"];?>" />
+<input type="hidden" name="wishID" value="<?php echo  `$wish` ["id"];?>" />
 ----
 
 
@@ -312,27 +309,35 @@ You need to add the following functions:
 
 *To update editWish.php so that it verifies if a wish is new and updates it if it is not new:*
 
-1. Add the  ``update_wish``  function to  ``db.php`` .
+1. Add the  `update_wish`  function to  `db.php` .
 
 *For the MySQL database:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function update_wish($wishID, $description, $duedate){
-    $description = $this->real_escape_string($description);if ($duedate==''){$this->query("UPDATE wishes SET description = '" . $description . "',due_date = NULL WHERE id = " . $wishID);} else$this->query("UPDATE wishes SET description = '" . $description ."', due_date = " . $this->format_date_for_sql($duedate). " WHERE id = " . $wishID);}  
+public function update_wish($wishID, $description, $duedate) {
+    $description = $this->real_escape_string($description);
+    if ($duedate==''){
+        $this->query("UPDATE wishes SET description = '" . $description . "',
+            due_date = NULL WHERE id = " . $wishID);
+    } else
+        $this->query("UPDATE wishes SET description = '" . $description .
+            "', due_date = " . $this->format_date_for_sql($duedate)
+            . " WHERE id = " . $wishID);
+}
 ----
 
 *For the Oracle database:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function update_wish($wishID, $description, $duedate) {
-    $query = "UPDATE wishes SET description = :desc_bv, due_date = to_date(:due_date_bv, 
-              'YYYY-MM-DD')  WHERE id = :wish_id_bv";
+    $query = "UPDATE wishes SET description = :desc_bv, due_date = to_date(:due_date_bv, 'YYYY-MM-DD') 
+                WHERE id = :wish_id_bv";
     $stid = oci_parse($this->con, $query);
     oci_bind_by_name($stid, ':wish_id_bv', $wishID);
     oci_bind_by_name($stid, ':desc_bv', $description);
@@ -341,21 +346,23 @@ public function update_wish($wishID, $description, $duedate) {
 
 }
 ----
-2. Add the  ``get_wish_by_wish_id``  function to  ``db.php`` .
+2. Add the  `get_wish_by_wish_id`  function to  `db.php` .
 
 *For the MySQL database:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function get_wish_by_wish_id ($wishID) {return $this->query("SELECT id, description, due_date FROM wishes WHERE id = " . $wishID);}
+public function get_wish_by_wish_id ($wishID) {
+    return $this->query("SELECT id, description, due_date FROM wishes WHERE id = " . $wishID);
+}
 ----
 
 *For the Oracle database:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wish_by_wish_id($wishID) {
@@ -366,37 +373,51 @@ public function get_wish_by_wish_id($wishID) {
     return $stid;
 }
 ----
-3. In the main, top PHP block of  ``editWish.php`` , add a condition to the final `else` statement. This is the  ``else``  statement that inserts the wish to the database. Change it to an  ``else if``  statement:
+3. In the main, top PHP block of  `editWish.php` , add a condition to the final `else` statement. This is the  `else`  statement that inserts the wish to the database. Change it to an  `else if`  statement:
 
-[source,java]
+[source,php]
 ----
 
-else if ($_POST["wishID"]=="") {WishDB::getInstance()->insert_wish($wisherID, $_POST["wish"], $_POST["dueDate"]);header('Location:  ``editWishList.php`` ' );exit;}
+else if ($_POST["wishID"]=="") {
+    WishDB::getInstance()->insert_wish($wisherID, $_POST["wish"], $_POST["dueDate"]);
+    header('Location: editWishList.php' );
+    exit;
+}
 ----
-4. Type or paste another  ``else if``  statement below the one you just edited:
+4. Type or paste another  `else if`  statement below the one you just edited:
 
-[source,java]
+[source,php]
 ----
 
-else if ($_POST["wishID"]!="") {WishDB::getInstance()->update_wish($_POST["wishID"], $_POST["wish"], $_POST["dueDate"]);header('Location:  ``editWishList.php`` ' );exit;
+else if ($_POST["wishID"]!="") {
+    WishDB::getInstance()->update_wish($_POST["wishID"], $_POST["wish"], $_POST["dueDate"]);
+    header('Location: editWishList.php' );
+    exit;
 } 
 ----
 
-The code checks that the  ``wishID``  element in the  ``$_POST``  array is not an empty string, which means that the user was redirected from the  ``editWishList.php``  page by pressing the Edit button and that the user has filled in the description of the wish. If the check is successful, the code calls the function  ``update_wish``  with the input parameters  ``wishID`` ,  ``description`` , and  ``dueDate. `` These parameters are received from the HTML input form through the POST metho [...]
+The code checks that the  `wishID`  element in the  `$_POST`  array is not an empty string, which means that the user was redirected from the  `editWishList.php`  page by pressing the Edit button and that the user has filled in the description of the wish. If the check is successful, the code calls the function  `update_wish`  with the input parameters  `wishID` ,  `description` , and  `dueDate. ` These parameters are received from the HTML input form through the POST method. After  `upd [...]
 
 
 == Testing the Edit Wish Functionality
 
 1. Run the application. On the index.php page, fill in the fields: in the Username field, enter "Tom", in the Password field, enter "tomcat".
+
 image::images/user-logon-to-edit-wish-list.png[]
-2. Press the Edit My Wish List button. The  ``editWishList.php``  page opens.
+
+2. Press the Edit My Wish List button. The  `editWishList.php`  page opens.
+
 image::images/edit-wish-list-edit-wish.png[]
-3. Click Edit next to Icecream. The  ``editWish.php``  page opens.
+
+3. Click Edit next to Icecream. The  `editWish.php`  page opens.
 image::images/edit-wish.png[]
-4. Edit the fields and press Back to the List. The  ``editWishList.php``  page opens but the changes are not saved.
+4. Edit the fields and press Back to the List. The  `editWishList.php`  page opens but the changes are not saved.
 5. Press Edit next to Icecream. Clear the Describe your wish field and press Save Changes. An error message is displayed.
+
 image::images/editWishEmptyDescription.png[]
-6. Enter Chocolate icecream in the Describe your wish field and press Save Changes. The  ``editWishList.php``  page opens with the updated list.
+
+6. Enter Chocolate icecream in the Describe your wish field and press Save Changes. The  `editWishList.php`  page opens with the updated list.
+
 image::images/editWishListWishAdded.png[]
 
 
@@ -406,22 +427,24 @@ Now that you can create, read, and update wishes, add a method for deleting a wi
 
 *To enable the user to delete wishes:*
 
-1. Add a `` delete_wish``  function to  ``db.php`` .
+1. Add a ` delete_wish`  function to  `db.php` .
 
 *For the MySQL database:*
 
 
-[source,java]
+[source,php]
 ----
 
-function delete_wish ($wishID){$this->query("DELETE FROM wishes WHERE id = " . $wishID);}
+function delete_wish ($wishID){
+    $this->query("DELETE FROM wishes WHERE id = " . $wishID);
+}
 
 ----
 
 *For the Oracle database:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function delete_wish($wishID) {
@@ -431,32 +454,37 @@ public function delete_wish($wishID) {
     oci_execute($stid); 
 }
 ----
-2. Create a new PHP file named  ``deleteWish.php``  and enter the following code into the <? php ?> block:
+2. Create a new PHP file named  `deleteWish.php`  and enter the following code into the <? php ?> block:
 
-[source,java]
+[source,php]
 ----
 
-require_once("Includes/db.php");WishDB::getInstance()->delete_wish ($_POST["wishID"]);header('Location:  ``editWishList.php`` ' );
+require_once("Includes/db.php");
+WishDB::getInstance()->delete_wish ($_POST["wishID"]);
+header('Location: editWishList.php' );
 ----
-The code enables the use of the  ``db.php``  file. It then calls the function  ``delete_wish``  from an instance of WishDB, with the  ``wishID``  as the input parameter. Finally, the application is redirected to the  ``editWishList.php``  page.
-3. To implement the Delete button, add another HTML table cell to the  ``while``  loop in  ``editWishList.php`` , directly below the code block for the  ``editWish``  button. The HTML input form contains a hidden field for the  ``wishID``  and a submit button labelled Delete. (Code for the MySQL database is shown, but the added code is the same and in the same location for Oracle Database.)
+The code enables the use of the  `db.php`  file. It then calls the function  `delete_wish`  from an instance of WishDB, with the  `wishID`  as the input parameter. Finally, the application is redirected to the  `editWishList.php`  page.
+3. To implement the Delete button, add another HTML table cell to the  `while`  loop in  `editWishList.php` , directly below the code block for the  `editWish`  button. The HTML input form contains a hidden field for the  `wishID`  and a submit button labelled Delete. (Code for the MySQL database is shown, but the added code is the same and in the same location for Oracle Database.)
 
 [source,php]
 ----
 
-    while ($row = mysqli_fetch_array($result))*:*echo "<tr><td>" . htmlentities($row["description"]) . "</td>";echo "<td>" . htmlentities($row["due_date"]) . "</td>[.line-through]#</tr>\n#";?>
+    while ($row = mysqli_fetch_array($result)):
+        echo "<tr><td>" . htmlentities($row["description"]) . "</td>";
+        echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";
+    ?>
     <td>
         <form name="editWish" action="editWish.php" method="GET">
-           <input type="hidden" name="wishID" value="<?php echo  ``$wish`` ID; ?>">
+           <input type="hidden" name="wishID" value="<?php echo $wishID; ?>">
            <input type="submit" name="editWish" value="Edit">
         </form>
     </td>
-    *<td>
+    <td>
         <form name="deleteWish" action="deleteWish.php" method="POST">
             <input type="hidden" name="wishID" value="<?php echo $wishID; ?>"/>
             <input type="submit" name="deleteWish" value="Delete"/>
         </form>
-    </td>*
+    </td>
     <?php
     echo "</tr>\n";
     endwhile;
@@ -465,7 +493,7 @@ The code enables the use of the  ``db.php``  file. It then calls the function  `
 </table>
 ----
 
-The entire table, including the form with the Edit button inside the  ``while `` loop, now looks like this:
+The entire table, including the form with the Edit button inside the  `while ` loop, now looks like this:
 
 *For the MySQL database:*
 
@@ -480,7 +508,7 @@ The entire table, including the form with the Edit button inside the  ``while ``
     $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);
     $result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
     while($row = mysqli_fetch_array($result)):
-        echo "<tr><td>" . htmlentities($row['description") . "</td>";
+        echo "<tr><td>" . htmlentities($row['description']) . "</td>";
         echo "<td>" . htmlentities($row['due_date']) . "</td>";
         $wishID = $row["id"];
     ?>
@@ -544,16 +572,16 @@ The entire table, including the form with the Edit button inside the  ``while ``
 
 == Testing the Delete Wish Functionality
 
-To check that the functionality is implemented correctly, press Delete next to any item on the  ``editWishList.php``  page. The item is no longer on the list.
+To check that the functionality is implemented correctly, press Delete next to any item on the  `editWishList.php`  page. The item is no longer on the list.
 
 image::images/deleteWish.png[]
 
 
 == Application Source Code after the Current Lesson Is Completed
 
-MySQL users: Click link:https://netbeans.org/files/documents/4/1933/lesson7.zip[+ here+] to download the source code that reflects the project state after the lesson is completed.
+MySQL users: Click link:https://netbeans.org/files/documents/4/1933/lesson7.zip[+here+] to download the source code that reflects the project state after the lesson is completed.
 
-Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson7.zip[+ here+] to download the source code that reflects the project state after the lesson is completed.
+Oracle Database users: Click link:https://netbeans.org/projects/www/downloads/download/php%252Foracle-lesson7.zip[+here+] to download the source code that reflects the project state after the lesson is completed.
 
 
 == Next Steps
diff --git a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson7_ja.asciidoc b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson7_ja.asciidoc
index 83bb34d..1f79ea4 100644
--- a/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson7_ja.asciidoc
+++ b/netbeans.apache.org/src/content/kb/docs/php/wish-list-lesson7_ja.asciidoc
@@ -42,32 +42,10 @@
 :keywords: Apache NetBeans, Tutorials, レッスン7: データベース内のエントリの更新および削除
 
 
-
-1. link:wish-list-tutorial-main-page.html[+PHPを使用するデータベース駆動型アプリケーションの作成 - メイン・ページ+]
-2. 
-データベースの作成
-
-1. link:wish-list-lesson1.html[+MySQLデータベースの作成+]
-2. link:wish-list-oracle-lesson1.html[+Oracleデータベース表の作成+]
-3. 
-link:wish-list-lesson2.html[+アプリケーションの設計。データベースからの読取り+]
-
-4. link:wish-list-lesson3.html[+新規アプリケーション・ユーザーの作成+]
-5. link:wish-list-lesson4.html[+コードの最適化+]
-6. link:wish-list-lesson5.html[+セキュリティの追加。アプリケーション・ユーザー・ログオンの実装+]
-7. link:wish-list-lesson6.html[+データベースへの新しいウィッシュの追加+]
-8. 
-*=> データベース内のエントリの更新および削除*
-
-9. link:wish-list-lesson8.html[+CSSテクノロジを使用したアプリケーションの外観の改良+]
-10. link:wish-list-lesson9.html[+リモートWebサーバーへのアプリケーションのデプロイ+]
-
-image::images/netbeans-stamp-80-74-73.png[title="このページの内容は、NetBeans IDE 7.2、7.3、7.4および8.0に適用されます"]
-
 このレッスンでは、次の2つの機能を使用してアプリケーションの機能を拡張します。
 
 
-これらの機能を実装するには、 ``editWishList.php`` ファイルと ``editWish.php`` ファイルを編集します。また、 ``deleteWish.php`` という名前の新しいファイルも作成します。
+これらの機能を実装するには、 `editWishList.php` ファイルと `editWish.php` ファイルを編集します。また、 `deleteWish.php` という名前の新しいファイルも作成します。
 
 image::images/page-flow-diagram-l7.png[]
 
@@ -86,85 +64,109 @@ Oracleデータベース・ユーザー: 前のレッスンが完了した後の
 
 この機能は、次のユース・ケースをサポートしています。
 
-*  ``editWishList.php`` ページで、ユーザーがウィッシュの右にある「Edit」ボタンを押す。選択したウィッシュのデータがある ``editWish.php`` ページが開く。
+*  `editWishList.php` ページで、ユーザーがウィッシュの右にある「Edit」ボタンを押す。選択したウィッシュのデータがある `editWish.php` ページが開く。
 * ユーザーがウィッシュの説明または期日(あるいはその両方)を変更し、「Save Changes」ボタンを押す。
-* 説明が入力されて_いない_場合、エラー・メッセージが表示され、ユーザーが ``editWish.php`` ページに戻される。
-* 説明が入力されている場合、アプリケーションはウィッシュが更新される ``editWishList.php`` ページに戻る。
+* 説明が入力されて_いない_場合、エラー・メッセージが表示され、ユーザーが `editWish.php` ページに戻される。
+* 説明が入力されている場合、アプリケーションはウィッシュが更新される `editWishList.php` ページに戻る。
 
 この実装は、次の手順から構成されます。
 
-* <<addEditButton,editWishListページに「Edit」ボタンを追加する>>
-* <<wishArrayUpdate,editWish.phpページで、ウィッシュのデータを格納する配列$wishを更新する>>
-* <<updateInputForm,editWish.phpページの入力フォームを更新する>>
-* <<updateWishRecord,送信されたデータを検証し、データベース内のウィッシュを更新する>>
-
+* <<_implementing_the_edit_button,editWishListページに「Edit」ボタンを追加する>>
+* <<_expanding_the_code_wish_code_array,editWish.phpページで、ウィッシュのデータを格納する配列$wishを更新する>>
+* <<_updating_the_html_input_form,editWish.phpページの入力フォームを更新する>>
+* <<_updating_the_wish_in_the_database,送信されたデータを検証し、データベース内のウィッシュを更新する>>
 
 === 「Edit」ボタンの実装
 
- ``editWishList.php`` では、ウィッシャのウィッシュを含む表は、ウィッシュがデータベースから選択されるときに、ウィッシュを含む行を表示するループ( ``while`` 文)によって実装されています。行の一番右のセルとして「Edit」ボタンを追加します。
+ `editWishList.php` では、ウィッシャのウィッシュを含む表は、ウィッシュがデータベースから選択されるときに、ウィッシュを含む行を表示するループ( `while` 文)によって実装されています。行の一番右のセルとして「Edit」ボタンを追加します。
 
-1. HTML入力フォームを使用してウィッシュのIDを転送するには、そのIDを変数に格納します。次のコード行を ``while`` ループの末尾に入力します。
+1. HTML入力フォームを使用してウィッシュのIDを転送するには、そのIDを変数に格納します。次のコード行を `while` ループの末尾に入力します。
 
-[source,java]
+[source,php]
 ----
-
-while ($row = ...) {echo ...echo ...*$wishID = $row["id"];*}
-?>
+while ($row = mysqli_fetch_array($result)):
+    echo "<tr><td>" . htmlentities($row['description']) . "</td>";
+    echo "<td>" . htmlentities($row['due_date']) . "</td>";
+    $wishID = $row['id'];
+    echo "<td>WishID=" . $wishID . "</td>";
+    //The loop is left open
+    ?>
 ----
-2. 編集ボタンを実装します。editWishフォームを使用して、終了の</table>タグの前に別の表のセルを追加します。このフォームには、ボタン・コンポーネントと、ボタンがクリックされたときに ``$wishID`` の値を送信する非表示コンポーネントが含まれています。(MySQLデータベース用のコードが示されていますが、追加されるコードはOracleデータベースの場合も同じで、同じ場所になります。)
+2. 編集ボタンを実装します。editWishフォームを使用して、終了の</table>タグの前に別の表のセルを追加します。このフォームには、ボタン・コンポーネントと、ボタンがクリックされたときに `$wishID` の値を送信する非表示コンポーネントが含まれています。(MySQLデータベース用のコードが示されていますが、追加されるコードはOracleデータベースの場合も同じで、同じ場所になります。)
 
 [source,php]
 ----
 
-   Hello <?php echo $_SESSION["user"]; ?><br/><table border="black"><tr><th>Item</th><th>Due Date</th></tr><?phprequire_once("Includes/db.php");$wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);$result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);while ($row = mysqli_fetch_array($result)) {echo "<tr><td>" . htmlentities($row["description"]) . "</td>";echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";}mysqli_free_result($result);?>
-            *<td>
-                <form name="editWish" action="editWish.php" method="GET">
-                    <input type="hidden" name="wishID" value="<?php echo  ``$wish`` ID; ?>">
-                    <input type="submit" name="editWish" value="Edit">
-                    </form>
-            </td>*</table>
+Hello <?php echo $_SESSION["user"]; ?><br/>
+<table border="black">
+    <tr><th>Item</th><th>Due Date</th></tr>
+    <?php
+    require_once("Includes/db.php");
+    $wisherID = WishDB::getInstance()->get_wisher_id_by_name($_SESSION["user"]);
+    $result = WishDB::getInstance()->get_wishes_by_wisher_id($wisherID);
+    while ($row = mysqli_fetch_array($result)) {
+        echo "<tr><td>" . htmlentities($row["description"]) . "</td>";
+        echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
+    <td>
+        <form name="editWish" action="editWish.php" method="GET">
+            <input type="hidden" name="wishID" value="<?php echo $wishID; ?>">
+            <input type="submit" name="editWish" value="Edit">
+        </form>
+    </td>
+</table>
 ----
-3.  ``while`` ループを変更してlink:http://www.php.net/manual/en/control-structures.alternative-syntax.php[+代替構文+]を使用します。これにより、 ``while`` ループ内のHTMLブロックを実行しやすくなります。代替の ``while`` ループ構文では、開始の中括弧{がコロン(:)に置き換えられ、終了の中括弧}が ``endwhile;`` 文に置き換えられます。開始の中括弧をコロンに置き換え、終了の中括弧を削除し、 ``endwhile;`` 文を使用して終了の</table>タグの前に新しいPHPブロックを追加します。これにより、新しい表のセルが ``while`` ループに組み込まれます。結果または文を解放するコードを ``endwhile;`` 文の後に移動します。(ここでも、MySQL用のコードが示されていますが、コード変更および場所はOracleデータベースの場合も同じです。)
+3.  `while` ループを変更してlink:http://www.php.net/manual/en/control-structures.alternative-syntax.php[+代替構文+]を使用します。これにより、 `while` ループ内のHTMLブロックを実行しやすくなります。代替の `while` ループ構文では、開始の中括弧{がコロン(:)に置き換えられ、終了の中括弧}が `endwhile;` 文に置き換えられます。開始の中括弧をコロンに置き換え、終了の中括弧を削除し、 `endwhile;` 文を使用して終了の</table>タグの前に新しいPHPブロックを追加します。これにより、新しい表のセルが `while` ループに組み込まれます。結果または文を解放するコードを `endwhile;` 文の後に移動します。(ここでも、MySQL用のコードが示されていますが、コード変更および場所はOracleデータベースの場合も同じです。)
 
 [source,php]
 ----
 
-    while ($row = mysqli_fetch_array($result))[.line-through]#{#*:*echo "<tr><td>" . htmlentities($row["description"]) . "</td>";echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";[.line-through]#    }mysqli_free_result($result);#?>
+   while ($row = mysqli_fetch_array($result)){:
+        echo "<tr><td>" . htmlentities($row["description"]) . "</td>";
+        echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";
+    }
+    mysqli_free_result($result);
+    ?>
     <td>
         <form name="editWish" action="editWish.php" method="GET">
-           <input type="hidden" name="wishID" value="<?php echo  ``$wish`` ID; ?>">
+           <input type="hidden" name="wishID" value="<?php echo $wishID; ?>">
            <input type="submit" name="editWish" value="Edit">
         </form>
     </td>
-*    <?php
+    <?php
     endwhile;
     mysqli_free_result($result);
-    ?>*
+    ?>
 </table>
 ----
 4. 
-表の行の構文を修正します。行を終了する</tr>\n文字を、期日のecho文から ``endwhile;`` のすぐ上の新しいecho文に移動します。
+表の行の構文を修正します。行を終了する</tr>\n文字を、期日のecho文から `endwhile;` のすぐ上の新しいecho文に移動します。
 
 
 [source,php]
 ----
 
-    while ($row = mysqli_fetch_array($result))*:*echo "<tr><td>" . htmlentities($row["description"]) . "</td>";echo "<td>" . htmlentities($row["due_date"]) . "</td>[.line-through]#</tr>\n#";?>
+    while ($row = mysqli_fetch_array($result)):
+        echo "<tr><td>" . htmlentities($row["description"]) . "</td>";
+        echo "<td>" . htmlentities($row["due_date"]) . "</td></tr>\n";
+    ?>
     <td>
         <form name="editWish" action="editWish.php" method="GET">
-           <input type="hidden" name="wishID" value="<?php echo  ``$wish`` ID; ?>">
+           <input type="hidden" name="wishID" value="<?php echo $wishID; ?>">
            <input type="submit" name="editWish" value="Edit">
         </form>
     </td>
     <?php
-    *echo "</tr>\n";*
+    echo "</tr>\n";
     endwhile;
     mysqli_free_result($result);
     ?>
 </table>
 ----
 5. 
- ``while`` ループ内に「Edit」ボタンを持つフォームを含む表の全体は、次のようになります。
+ `while` ループ内に「Edit」ボタンを持つフォームを含む表の全体は、次のようになります。
 
 *MySQLデータベースの場合:*
 
@@ -197,6 +199,7 @@ while ($row = ...) {echo ...echo ...*$wishID = $row["id"];*}
 </table>
 ----
 
+
 *Oracleデータベースの場合:*
 
 
@@ -235,13 +238,13 @@ while ($row = ...) {echo ...echo ...*$wishID = $row["id"];*}
 ----
 
 
-===  ``$wish`` 配列の拡張
+===  `$wish` 配列の拡張
 
- ``editWishList.php`` ページで「Edit」ボタンを押すと、選択したウィッシュのIDがサーバー・リクエスト・メソッドGETを介して ``editWish.php`` ページに転送されます。ウィッシュのIDを格納するには、 ``$wish`` 配列に新しい要素を追加する必要があります。
+ `editWishList.php` ページで「Edit」ボタンを押すと、選択したウィッシュのIDがサーバー・リクエスト・メソッドGETを介して `editWish.php` ページに転送されます。ウィッシュのIDを格納するには、 `$wish` 配列に新しい要素を追加する必要があります。
 
-新しいウィッシュを追加するときに、それを保存しようとして失敗した後で、 ``editWishList.php`` ページと ``editWish.php`` ページの両方から入力フォームにアクセスできます。データを転送するサーバー・リクエスト・メソッドによって、ケースが識別されます。GETは、ユーザーが「Edit Wish」を押して最初にページに達するときに、フォームが表示されることを示します。POSTは、説明なしでウィッシュを保存しようとした後、ユーザーがフォームにリダイレクトされることを示します。
+新しいウィッシュを追加するときに、それを保存しようとして失敗した後で、 `editWishList.php` ページと `editWish.php` ページの両方から入力フォームにアクセスできます。データを転送するサーバー・リクエスト・メソッドによって、ケースが識別されます。GETは、ユーザーが「Edit Wish」を押して最初にページに達するときに、フォームが表示されることを示します。POSTは、説明なしでウィッシュを保存しようとした後、ユーザーがフォームにリダイレクトされることを示します。
 
- ``editWish.php`` 内で、HTML <body>内の ``EditWish`` 入力フォームの上にあるPHPブロックを、 ``$wish`` 配列の拡張されたコードで置き換えます。
+ `editWish.php` 内で、HTML <body>内の `EditWish` 入力フォームの上にあるPHPブロックを、 `$wish` 配列の拡張されたコードで置き換えます。
 
 *MySQLデータベースの場合:*
 
@@ -249,8 +252,15 @@ while ($row = ...) {echo ...echo ...*$wishID = $row["id"];*}
 [source,php]
 ----
 
-<?phpif ($_SERVER["REQUEST_METHOD"] == "POST")$wish = array("id" => $_POST["wishID"], "description" => 
-        $_POST["wish"], "due_date" => $_POST["dueDate"]);else if (array_key_exists("wishID", $_GET))$wish = mysqli_fetch_array(WishDB::getInstance()->get_wish_by_wish_id($_GET["wishID"]));else$wish = array("id" => "", "description" => "", "due_date" => "");?>
+<?php
+if ($_SERVER["REQUEST_METHOD"] == "POST")
+    $wish = array("id" => $_POST["wishID"], "description" => 
+            $_POST["wish"], "due_date" => $_POST["dueDate"]);
+else if (array_key_exists("wishID", $_GET))
+    $wish = mysqli_fetch_array(WishDB::getInstance()->get_wish_by_wish_id($_GET["wishID"]));
+else
+    $wish = array("id" => "", "description" => "", "due_date" => "");
+?>
 ----
 
 *Oracleデータベースの場合:*
@@ -262,7 +272,7 @@ while ($row = ...) {echo ...echo ...*$wishID = $row["id"];*}
 <?php
 if ($_SERVER["REQUEST_METHOD"] == "POST")
     $wish = array("id" => $_POST["wishID"], "description" =>
-            $_POST["wish"], "due_date" => $_POST["dueDate"]);
+                $_POST["wish"], "due_date" => $_POST["dueDate"]);
 else if (array_key_exists("wishID", $_GET)) {
     $stid = WishDB::getInstance()->get_wish_by_wish_id($_GET["wishID"]);
     $row = oci_fetch_array($stid, OCI_ASSOC);
@@ -270,23 +280,23 @@ else if (array_key_exists("wishID", $_GET)) {
                 $row["DESCRIPTION"], "due_date" => $row["DUE_DATE"]);
     oci_free_statement($stid);
 } else
-$wish = array("id" => "", "description" => "", "due_date" => "");
+    $wish = array("id" => "", "description" => "", "due_date" => "");
 ?>
 ----
 
-このコードは、 ``id`` 、 ``description`` 、および ``due_date`` の3つの要素を持つ ``$wish`` 配列を初期化します。これらの要素の値はサーバー・リクエスト・メソッドに依存します。サーバー・リクエスト・メソッドがPOSTの場合、値は入力フォームから受け取ります。また、サーバー・リクエスト・メソッドがGETで、$_GET配列にキー「wishID」を持つ要素が含まれている場合、値は関数get_wish_by_wish_idによってデータベースから取得されます。最後に、サーバー・リクエスト・メソッドがPOSTおよびGET以外の場合、つまり新しいウィッシュの追加のユース・ケースが行われた場合、要素は空になります。
+このコードは、 `id` 、 `description` 、および `due_date` の3つの要素を持つ `$wish` 配列を初期化します。これらの要素の値はサーバー・リクエスト・メソッドに依存します。サーバー・リクエスト・メソッドがPOSTの場合、値は入力フォームから受け取ります。また、サーバー・リクエスト・メソッドがGETで、$_GET配列にキー「wishID」を持つ要素が含まれている場合、値は関数get_wish_by_wish_idによってデータベースから取得されます。最後に、サーバー・リクエスト・メソッドがPOSTおよびGET以外の場合、つまり新しいウィッシュの追加のユース・ケースが行われた場合、要素は空になります。
 
 前述のコードは、ウィッシュを作成および編集するケースをカバーしています。また、入力フォームを両方のケースに使用できるように、入力フォームを更新する必要があります。
 
 
 === HTML入力フォームの更新
 
-現時点では、新しいウィッシュを作成するとき、ウィッシュIDがなくても入力フォームは機能します。既存のウィッシュを編集する場合にフォームが機能するようにするには、ウィッシュのIDを転送するための非表示フィールドを追加する必要があります。非表示フィールドの値は、$wish配列から取得されます。新しいウィッシュの作成中、この値は空の文字列です。ウィッシュが編集される場合、非表示フィールドの値がウィッシュのIDに変わります。この非表示フィールドを作成するには、 ``editWish.php`` の ``EditWish`` 入力フォームの先頭に次の行を追加します。
+現時点では、新しいウィッシュを作成するとき、ウィッシュIDがなくても入力フォームは機能します。既存のウィッシュを編集する場合にフォームが機能するようにするには、ウィッシュのIDを転送するための非表示フィールドを追加する必要があります。非表示フィールドの値は、$wish配列から取得されます。新しいウィッシュの作成中、この値は空の文字列です。ウィッシュが編集される場合、非表示フィールドの値がウィッシュのIDに変わります。この非表示フィールドを作成するには、 `editWish.php` の `EditWish` 入力フォームの先頭に次の行を追加します。
 
 [source,php]
 ----
 
-<input type="hidden" name="wishID" value="<?php echo  ``$wish`` ["id"];?>" />
+<input type="hidden" name="wishID" value="<?php echo  `$wish` ["id"];?>" />
 ----
 
 
@@ -301,27 +311,35 @@ $wish = array("id" => "", "description" => "", "due_date" => "");
 
 *ウィッシュが新規であるかどうかを確認し、新規でない場合はウィッシュを更新するようにeditWish.phpを更新するには:*
 
-1.  ``update_wish`` 関数を ``db.php`` に追加します。
+1.  `update_wish` 関数を `db.php` に追加します。
 
 *MySQLデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function update_wish($wishID, $description, $duedate){
-    $description = $this->real_escape_string($description);if ($duedate==''){$this->query("UPDATE wishes SET description = '" . $description . "',due_date = NULL WHERE id = " . $wishID);} else$this->query("UPDATE wishes SET description = '" . $description ."', due_date = " . $this->format_date_for_sql($duedate). " WHERE id = " . $wishID);}  
+public function update_wish($wishID, $description, $duedate) {
+    $description = $this->real_escape_string($description);
+    if ($duedate==''){
+        $this->query("UPDATE wishes SET description = '" . $description . "',
+            due_date = NULL WHERE id = " . $wishID);
+    } else
+        $this->query("UPDATE wishes SET description = '" . $description .
+            "', due_date = " . $this->format_date_for_sql($duedate)
+            . " WHERE id = " . $wishID);
+}
 ----
 
 *Oracleデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function update_wish($wishID, $description, $duedate) {
-    $query = "UPDATE wishes SET description = :desc_bv, due_date = to_date(:due_date_bv, 
-              'YYYY-MM-DD')  WHERE id = :wish_id_bv";
+    $query = "UPDATE wishes SET description = :desc_bv, due_date = to_date(:due_date_bv, 'YYYY-MM-DD') 
+                WHERE id = :wish_id_bv";
     $stid = oci_parse($this->con, $query);
     oci_bind_by_name($stid, ':wish_id_bv', $wishID);
     oci_bind_by_name($stid, ':desc_bv', $description);
@@ -331,21 +349,22 @@ public function update_wish($wishID, $description, $duedate) {
 }
 ----
 2. 
- ``get_wish_by_wish_id`` 関数を ``db.php`` に追加します。
+ `get_wish_by_wish_id` 関数を `db.php` に追加します。
 
 *MySQLデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
-public function get_wish_by_wish_id ($wishID) {return $this->query("SELECT id, description, due_date FROM wishes WHERE id = " . $wishID);}
+public function get_wish_by_wish_id ($wishID) {
+    return $this->query("SELECT id, description, due_date FROM wishes WHERE id = " . $wishID);
+}
 ----
-
 *Oracleデータベースの場合:*
 
 
-[source,java]
+[source,php]
 ----
 
 public function get_wish_by_wish_id($wishID) {
@@ -356,37 +375,53 @@ public function get_wish_by_wish_id($wishID) {
     return $stid;
 }
 ----
-3.  ``editWish.php`` のメインとなる先頭のPHPブロックで、最後の`else`文に条件を追加します。これはデータベースにウィッシュを挿入する ``else`` 文です。これを ``else if`` 文に変更します。
+3.  `editWish.php` のメインとなる先頭のPHPブロックで、最後の`else`文に条件を追加します。これはデータベースにウィッシュを挿入する `else` 文です。これを `else if` 文に変更します。
 
-[source,java]
+[source,php]
 ----
 
-else if ($_POST["wishID"]=="") {WishDB::getInstance()->insert_wish($wisherID, $_POST["wish"], $_POST["dueDate"]);header('Location:  ``editWishList.php`` ' );exit;}
+else if ($_POST["wishID"]=="") {
+    WishDB::getInstance()->insert_wish($wisherID, $_POST["wish"], $_POST["dueDate"]);
+    header('Location: editWishList.php' );
+    exit;
+}
 ----
-4. 別の ``else if`` 文を、前に編集した文の下に入力するか、または貼り付けます。
+4. 別の `else if` 文を、前に編集した文の下に入力するか、または貼り付けます。
 
-[source,java]
+[source,php]
 ----
 
-else if ($_POST["wishID"]!="") {WishDB::getInstance()->update_wish($_POST["wishID"], $_POST["wish"], $_POST["dueDate"]);header('Location:  ``editWishList.php`` ' );exit;
+else if ($_POST["wishID"]!="") {
+    WishDB::getInstance()->update_wish($_POST["wishID"], $_POST["wish"], $_POST["dueDate"]);
+    header('Location: editWishList.php' );
+    exit;
 } 
 ----
 
-このコードは、 ``$_POST`` 配列内の ``wishID`` 要素が空の文字列ではないことを確認します(これは、ユーザーが「Edit」ボタンを押すことによって ``editWishList.php`` ページからリダイレクトされたこと、および、ユーザーがウィッシュの説明を入力していたことを意味します)。確認が成功すると、コードは入力パラメータ ``wishID`` 、 ``description`` 、および ``dueDate`` を使用して関数 ``update_wish`` をコールします。これらのパラメータは、HTML入力フォームからPOSTメソッドを介して受け取ります。 ``update_wish`` がコールされた後、アプリケーションは ``editWishList.php`` ページにリダイレクトされ、PHP処理は取り消されます。
+このコードは、 `$_POST` 配列内の `wishID` 要素が空の文字列ではないことを確認します(これは、ユーザーが「Edit」ボタンを押すことによって `editWishList.php` ページからリダイレクトされたこと、および、ユーザーがウィッシュの説明を入力していたことを意味します)。確認が成功すると、コードは入力パラメータ `wishID` 、 `description` 、および `dueDate` を使用して関数 `update_wish` をコールします。これらのパラメータは、HTML入力フォームからPOSTメソッドを介して受け取ります。 `update_wish` がコールされた後、アプリケーションは `editWishList.php` ページにリダイレクトされ、PHP処理は取り消されます。
 
 
 == ウィッシュの編集機能のテスト
... 3937 lines suppressed ...


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists