<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/cppweb/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 15 Dec 2013 16:18:11 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/cppweb/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v47
+++ v48
@@ -215,10 +215,17 @@

 All widgets have two important methods: `EventHandler()` and `Draw()`. EventHandler fires when application receives request from user. Event is propagated to all child widgets. When all childs are finished processing event, Draw() method fires for all child widgets currently visible creating DOM structure. Generated DOM structure program converts into HTML and inserts it into template. Template is HTML skeleton that you provide - It's HTML file with empty body in which you can include your custom css files for styling, javascript files etc.

-
-Widgets example is included in "/examples/cppw_widgets/" directory. You can see live example &lt;a href="http://www.freevidcall.com/cppw_widgets" target="_blank" rel="nofollow"&gt;here&lt;/a&gt;.
-
-Example uses &lt;a href="http://getbootstrap.com/" target="_blank" rel="nofollow"&gt;Twitter Bootstrap&lt;/a&gt; theme for styling. Bootstrap template is included in "/templates/" directory.
+There are three examples using widgets:
+
+&lt;a href="http://www.freevidcall.com/cppw_widgets" target="_blank" rel="nofollow"&gt;cppw_widgets&lt;/a&gt; - application demonstrates creating buttons, dropdown buttons, navigation bars etc.
+
+&lt;a href="http://www.freevidcall.com/cppw_sqlite" target="_blank" rel="nofollow"&gt;cppw_sqlite&lt;/a&gt; - simple SQLite interactive query example.
+
+&lt;a href="http://www.freevidcall.com/cppw_login" target="_blank" rel="nofollow"&gt;cppw_login&lt;/a&gt; - simple application with register, login, change password and reset password.
+
+
+Examples are using &lt;a href="http://getbootstrap.com/" target="_blank" rel="nofollow"&gt;Twitter Bootstrap&lt;/a&gt; theme for styling. Bootstrap template is included in "/templates/" directory.
+

 &lt;a id="database"&gt;&lt;/a&gt;Database access
@@ -308,19 +315,24 @@

 Examples are included into source package in "/examples/" directory. 

-There are 6 examples:
-
-**cppw_app** is example CWApp application demonstrating form input, file upload and dump of CGI variables and cookies. &lt;a href="http://www.freevidcall.com/cppw_app" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;
-
-**cppw_bridge** in order to run server, you need to compile and setup bridge first and create "cppw_bridge.conf" file.
-
-**cppw_server** is example CWServer application demonstrating form input (login) and server push via long polling. &lt;a href="http://www.freevidcall.com/cppw_server" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;
+There are 8 examples:
+
+**cppw_app** is example CWApp application demonstrating form input, file upload and dump of CGI variables and cookies. &lt;a href="http://www.freevidcall.com/cppw_app" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;.
+
+**cppw_bridge** in order to run cppw_server example, you need to compile and setup bridge first and create "cppw_bridge.conf" file.
+
+**cppw_server** is example CWServer application demonstrating form input (login) and server push via long polling. &lt;a href="http://www.freevidcall.com/cppw_server" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;.

 **cppw_parser** demonstrates HTML parsing and DOM manipulation. This is classic command line program - not a Web application. Just compile it and run from terminal.

-**cppw_widgets** demonstrates using CWWidget classes with Twitter Botstrap theme. &lt;a href="http://www.freevidcall.com/cppw_widgets" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;
-
-**cppw_sqlite** demonstrates using CWDatabase, CWQuery and CWWidget classes. This is simple SQLite interactive query application. &lt;a href="http://www.freevidcall.com/cppw_sqlite" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;
+**cppw_minify** this application parses HTML files in given source directory and uses &lt;a href="http://yui.github.io/yuicompressor/" target="_blank" rel="nofollow"&gt;YUI compressor&lt;/a&gt; to minify internal and external scripts and styles. Resulting minified files are then stored into destination directory. This is classic command line program - not a Web application. Just compile it and run from terminal. I use it, maybe can be useful for you too.
+
+**cppw_widgets** demonstrates using CWWidget classes with Twitter Botstrap theme. &lt;a href="http://www.freevidcall.com/cppw_widgets" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;.
+
+**cppw_sqlite** demonstrates using CWDatabase, CWQuery and CWWidget classes. This is simple SQLite interactive query application. &lt;a href="http://www.freevidcall.com/cppw_sqlite" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;.
+
+**cppw_login** is basic application with authentication: register, login, reset password and change password form. It is based on CWApp and uses SQLite database. It uses "sendmail" program to send e-mails (reset password form). &lt;a href="http://www.freevidcall.com/cppw_login" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;.
+

 How to compile examples
@@ -342,11 +354,11 @@

 - Apache2 on Windows it's typicaly located at "C:\Program files\Apache Software Foundation\Apache2\cgi-bin\".

-Make sure that web user has "execute" access rights in "cgi-bin" directory (in apache/linux this is user named "www-data"). 
+Make sure that web user has "execute" access rights to "cgi-bin" directory (in apache/linux this is user named "www-data"). 

 Configure web server to enable CGI program execution.

-**For "cppw_server" example:**
+**"cppw_server" example:**

 Create "cppw_bridge.conf" file as mentioned in [CWBridge](#cwbridge) section of this tutorial. Example "cppw_bridge.conf" file (Linux):

@@ -355,7 +367,7 @@
 ~~~~~~ 
 &amp;nbsp;

-**For "cppw_widgets" example:**
+**"cppw_widgets" example:**

 Copy Twitter Bootstrap template from "/templates/" directory to your web server root (apache "htdocs" or "www" directory depending on platform).

@@ -367,13 +379,13 @@
 ~~~~~~
 &amp;nbsp;

-**For "cppw_sqlite" example:**
+**"cppw_sqlite" example:**

 You should install sqlite dev tools and link "libsqlite3" library to your program **or** you can include SQLite "amalgamation" source file into your program (SQLite amalgamation is complete SQLite source code in single .c file). You can download SQLite &lt;a href="http://www.sqlite.org/download.html" target="_blank" rel="nofollow"&gt;here&lt;/a&gt;.

 Copy Twitter Bootstrap template from "/templates/" directory to your web server root (apache "htdocs" or "www" directory depending on platform).

-Create "cppw_sqlite.conf" in same directory where is your "cppw_sqlite.cgi" program and enter path and relative URL to template index.html file. Also, you need to enter full path to database file ("cppw_sqlite.db" which is included in example directory). Make sure that web user has read-write access to directory containing database file (SQLite requires bot database file and directory to be read-write). Config file should look something like this (Linux):
+Create "cppw_sqlite.conf" in same directory where is your "cppw_sqlite.cgi" program and enter path and relative URL to template index.html file. Also, you need to enter full path to database file ("cppw_sqlite.db" which is included in example directory). Make sure that web user has read-write access to directory containing database file (SQLite requires both database file and directory to be read-write). Config file should look something like this (Linux):

 ~~~~~~
 TemplatePath=/var/www/templates/bootstrap/index.html
@@ -383,6 +395,32 @@
 &amp;nbsp;

+**"cppw_login" example:**
+
+You should install and link "libsqlite3" library to your program (see "cppw_sqlite" above).
+
+Reset password form uses "sendmail" program for sending e-mails, so you have to install and configure &lt;a href="http://www.sendmail.org" target="_blank" rel="nofollow"&gt;sendmail&lt;/a&gt;. You can download fake sendmail for Windows &lt;a href="http://glob.com.au/sendmail/" target="_blank" rel="nofollow"&gt;here&lt;/a&gt;.
+
+Copy Twitter Bootstrap template from "/templates/" directory to your web server root (apache "htdocs" or "www" directory depending on platform).
+
+Create "cppw_login.conf" in same directory where is your "cppw_login.cgi" program and enter path and relative URL to template index.html file. Also, you need to enter full path to database file ("cppw_login.db" which is included in example directory). Make sure that web user has read-write access to directory containing database file (SQLite requires both database file and directory to be read-write). 
+
+Add to config file path to your "sendmail" program and your e-mail address to be used as "from" address. 
+
+Config file should look something like this (Linux):
+
+~~~~~~
+TemplatePath=/var/www/templates/bootstrap/index.html
+TemplateRootURL=/templates/bootstrap/
+
+DatabaseName=/usr/lib/cgi-bin/db/cppw_login.db
+
+SendMailPath=/usr/lib/sendmail
+NoReplyEMailAddress=noreply@your.e-mail
+~~~~~~
+&amp;nbsp;
+
+
 That's it.

 Author: Petar Korponaić
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Sun, 15 Dec 2013 16:18:11 -0000</pubDate><guid>https://sourceforge.netea69edc442291e1e0b889331a2ff851c0bb09aa3</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v46
+++ v47
@@ -284,7 +284,7 @@
   // ... do something with user_name...

   // read next row from database
-  if(!Query.Fetch(&amp;amp;error_message))
+  if(!query.Fetch(&amp;amp;error_message))
   {
     // ... error occoured
     query.Close();
@@ -292,7 +292,7 @@
   row++;
 }

-// Close query
+// close query
 query.Close();

 // close database connection
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Wed, 27 Nov 2013 22:23:29 -0000</pubDate><guid>https://sourceforge.net4de22e8a52bc31ae6b32883562db247a7b271081</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v45
+++ v46
@@ -221,7 +221,7 @@
 Example uses &lt;a href="http://getbootstrap.com/" target="_blank" rel="nofollow"&gt;Twitter Bootstrap&lt;/a&gt; theme for styling. Bootstrap template is included in "/templates/" directory.

-&lt;a id="database_access"&gt;&lt;/a&gt;Database access
+&lt;a id="database"&gt;&lt;/a&gt;Database access
 ===========================================

 Library contains simple wrapper for SQLite database (Files "cppw_db_sqlite.cpp" and "cppw_db_sqlite.h", classes "CWDatabase" and "CWQuery").
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Wed, 27 Nov 2013 10:01:48 -0000</pubDate><guid>https://sourceforge.net347d0fa64564408f1a43b734e98e34a81b28d545</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v44
+++ v45
@@ -221,7 +221,7 @@
 Example uses &lt;a href="http://getbootstrap.com/" target="_blank" rel="nofollow"&gt;Twitter Bootstrap&lt;/a&gt; theme for styling. Bootstrap template is included in "/templates/" directory.

-&lt;a id="database"&gt;&lt;/a&gt;Database access
+&lt;a id="database_access"&gt;&lt;/a&gt;Database access
 ===========================================

 Library contains simple wrapper for SQLite database (Files "cppw_db_sqlite.cpp" and "cppw_db_sqlite.h", classes "CWDatabase" and "CWQuery").
@@ -246,6 +246,8 @@
 // close database connection
 db.Close();
 ~~~~~~
+&amp;nbsp;
+

 **CWQuery** is SQL query class which is used for retrieving data from database. Example usage:

@@ -296,6 +298,7 @@
 // close database connection
 db.Close();
 ~~~~~~
+&amp;nbsp;

 Full example is included in "/examples/cppw_sqlite" directory. You can see live example &lt;a href="http://www.freevidcall.com/cppw_sqlite" target="_blank" rel="nofollow"&gt;here&lt;/a&gt;.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Wed, 27 Nov 2013 10:00:59 -0000</pubDate><guid>https://sourceforge.net66b047251c6f9e507dd14870267f50e67a083912</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v43
+++ v44
@@ -10,6 +10,7 @@
 * [CWBridge](#cwbridge)
 * [HTML parsing and DOM manipulation](#cwnode)
 * [GUI Widgets](#cwwidget)
+* [Database access](#database)
 * [Examples](#run_examples)

 &lt;a id="introduction"&gt;&lt;/a&gt;Introduction
@@ -215,9 +216,88 @@
 All widgets have two important methods: `EventHandler()` and `Draw()`. EventHandler fires when application receives request from user. Event is propagated to all child widgets. When all childs are finished processing event, Draw() method fires for all child widgets currently visible creating DOM structure. Generated DOM structure program converts into HTML and inserts it into template. Template is HTML skeleton that you provide - It's HTML file with empty body in which you can include your custom css files for styling, javascript files etc.

-Widgets example is included in "/examples/cppw_widgets/" directory. 
+Widgets example is included in "/examples/cppw_widgets/" directory. You can see live example &lt;a href="http://www.freevidcall.com/cppw_widgets" target="_blank" rel="nofollow"&gt;here&lt;/a&gt;.

 Example uses &lt;a href="http://getbootstrap.com/" target="_blank" rel="nofollow"&gt;Twitter Bootstrap&lt;/a&gt; theme for styling. Bootstrap template is included in "/templates/" directory.
+
+
+&lt;a id="database"&gt;&lt;/a&gt;Database access
+===========================================
+
+Library contains simple wrapper for SQLite database (Files "cppw_db_sqlite.cpp" and "cppw_db_sqlite.h", classes "CWDatabase" and "CWQuery").
+
+**CWDatabase** is database connection class. Example usage:
+
+~~~~~~
+string error_message = "";
+CWDatabase db;
+// connect to database
+if(!db.Open("path_to_database_file.db", 3000, &amp;amp;error_message))
+{
+  // ... error occoured
+}
+
+// execute SQL statement which doesn't return data
+if(!db.Execute("INSERT INTO USERS (USR_FULL_NAME) VALUES (\"Chuck Norris\");", &amp;amp;error_message)
+{
+  // ... error occoured
+}
+
+// close database connection
+db.Close();
+~~~~~~
+
+**CWQuery** is SQL query class which is used for retrieving data from database. Example usage:
+
+~~~~~~
+string error_message = "";
+CWDatabase db;
+
+// connect to database
+if(!db.Open("path_to_database_file.db", 3000, &amp;amp;error_message))
+{
+  // ... error occoured
+}
+
+CWQuery query(&amp;amp;db);
+
+// execute SELECT statement
+if(!query.Open("SELECT * FROM USERS;", false, &amp;amp;error_message))
+{
+  // ... error occoured
+}
+
+// read all returned rows
+int row = 0;
+while(!query.Eof())
+{
+  // read user name field
+  string user_name = query.GetValue("USR_FULL_NAME", row, &amp;amp;read_success, &amp;amp;error_message);
+  if(!read_success)
+  {
+    // ... error occoured
+    query.Close();
+  }
+  
+  // ... do something with user_name...
+  
+  // read next row from database
+  if(!Query.Fetch(&amp;amp;error_message))
+  {
+    // ... error occoured
+    query.Close();
+  }
+  row++;
+}
+
+// Close query
+query.Close();
+
+// close database connection
+db.Close();
+~~~~~~
+
+Full example is included in "/examples/cppw_sqlite" directory. You can see live example &lt;a href="http://www.freevidcall.com/cppw_sqlite" target="_blank" rel="nofollow"&gt;here&lt;/a&gt;.

 &lt;a id="run_examples"&gt;&lt;/a&gt;How to run examples
@@ -225,7 +305,7 @@

 Examples are included into source package in "/examples/" directory. 

-There are 5 examples:
+There are 6 examples:

 **cppw_app** is example CWApp application demonstrating form input, file upload and dump of CGI variables and cookies. &lt;a href="http://www.freevidcall.com/cppw_app" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;

@@ -236,6 +316,8 @@
 **cppw_parser** demonstrates HTML parsing and DOM manipulation. This is classic command line program - not a Web application. Just compile it and run from terminal.

 **cppw_widgets** demonstrates using CWWidget classes with Twitter Botstrap theme. &lt;a href="http://www.freevidcall.com/cppw_widgets" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;
+
+**cppw_sqlite** demonstrates using CWDatabase, CWQuery and CWWidget classes. This is simple SQLite interactive query application. &lt;a href="http://www.freevidcall.com/cppw_sqlite" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;

 How to compile examples
@@ -263,7 +345,7 @@

 **For "cppw_server" example:**

-Create "cppw_bridge.conf" file as mentioned in [CWBridge](#cwbridge) section of this tutorial. Example "cppw_bridge.conf" file:
+Create "cppw_bridge.conf" file as mentioned in [CWBridge](#cwbridge) section of this tutorial. Example "cppw_bridge.conf" file (Linux):

 ~~~~~~
 ServerPath=/usr/lib/cgi-bin/cppw_server.cgi
@@ -282,7 +364,20 @@
 ~~~~~~
 &amp;nbsp;

-Open your browser and go to http://localhost/cgi-bin/cppw_app.cgi (CWApp example) or http://localhost/cgi-bin/cppw_bridge.cgi (CWServer example) or http://localhost/cgi-bin/cppw_widgets.cgi (CWWidgets example).
+**For "cppw_sqlite" example:**
+
+You should install sqlite dev tools and link "libsqlite3" library to your program **or** you can include SQLite "amalgamation" source file into your program (SQLite amalgamation is complete SQLite source code in single .c file). You can download SQLite &lt;a href="http://www.sqlite.org/download.html" target="_blank" rel="nofollow"&gt;here&lt;/a&gt;.
+
+Copy Twitter Bootstrap template from "/templates/" directory to your web server root (apache "htdocs" or "www" directory depending on platform).
+
+Create "cppw_sqlite.conf" in same directory where is your "cppw_sqlite.cgi" program and enter path and relative URL to template index.html file. Also, you need to enter full path to database file ("cppw_sqlite.db" which is included in example directory). Make sure that web user has read-write access to directory containing database file (SQLite requires bot database file and directory to be read-write). Config file should look something like this (Linux):
+
+~~~~~~
+TemplatePath=/var/www/templates/bootstrap/index.html
+TemplateRootURL=/templates/bootstrap/
+DatabaseName=/usr/lib/cgi-bin/db/cppw_sqlite.db
+~~~~~~
+&amp;nbsp;

 That's it.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Wed, 27 Nov 2013 09:57:55 -0000</pubDate><guid>https://sourceforge.net226c7f94e9316c3b8ea65ef6e8d05f4f1a7f5528</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v42
+++ v43
@@ -55,7 +55,7 @@
 string user_ip = Request-&gt;Env-&gt;GetValue("REMOTE_ADDR");
 ~~~~~~
 &amp;nbsp;
-Decoding is performed by excelent [libccgi](http://sourceforge.net/projects/libccgi/) library which is slightly modified and included in source (cppw_ccgi.cpp).
+Decoding is performed by excelent &lt;a href="http://sourceforge.net/projects/libccgi/" target="_blank"&gt;libccgi&lt;/a&gt; library which is slightly modified and included in source (cppw_ccgi.cpp).

 After CWApp receives and stores request data, it fires `OnRequest` handler which you have to instantiate and write your code to proccess request and generate reponse data.

@@ -217,7 +217,7 @@

 Widgets example is included in "/examples/cppw_widgets/" directory. 

-Example uses [Twitter Bootstrap](http://getbootstrap.com/) theme for styling. Bootstrap template is included in "/templates/" directory.
+Example uses &lt;a href="http://getbootstrap.com/" target="_blank" rel="nofollow"&gt;Twitter Bootstrap&lt;/a&gt; theme for styling. Bootstrap template is included in "/templates/" directory.

 &lt;a id="run_examples"&gt;&lt;/a&gt;How to run examples
@@ -227,15 +227,15 @@

 There are 5 examples:

-**cppw_app** is example CWApp application demonstrating form input, file upload and dump of CGI variables and cookies. [Live example](http://www.freevidcall.com/cppw_app)
+**cppw_app** is example CWApp application demonstrating form input, file upload and dump of CGI variables and cookies. &lt;a href="http://www.freevidcall.com/cppw_app" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;

 **cppw_bridge** in order to run server, you need to compile and setup bridge first and create "cppw_bridge.conf" file.

-**cppw_server** is example CWServer application demonstrating form input (login) and server push via long polling. [Live example](http://www.freevidcall.com/cppw_server)
+**cppw_server** is example CWServer application demonstrating form input (login) and server push via long polling. &lt;a href="http://www.freevidcall.com/cppw_server" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;

 **cppw_parser** demonstrates HTML parsing and DOM manipulation. This is classic command line program - not a Web application. Just compile it and run from terminal.

-**cppw_widgets** demonstrates using CWWidget classes with Twitter Botstrap theme. [Live example](http://www.freevidcall.com/cppw_widgets)
+**cppw_widgets** demonstrates using CWWidget classes with Twitter Botstrap theme. &lt;a href="http://www.freevidcall.com/cppw_widgets" target="_blank" rel="nofollow"&gt;Live example&lt;/a&gt;

 How to compile examples
@@ -289,6 +289,7 @@

 Author: Petar Korponaić

+
 [[members limit=20]]

 [[download_button]]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Mon, 25 Nov 2013 21:44:28 -0000</pubDate><guid>https://sourceforge.netf83876c05c2adf4c1cd54148579f303adcdcda79</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v41
+++ v42
@@ -227,15 +227,15 @@

 There are 5 examples:

-**cppw_app** is example CWApp application demonstrating form input, file upload and dump of CGI variables and cookies.
+**cppw_app** is example CWApp application demonstrating form input, file upload and dump of CGI variables and cookies. [Live example](http://www.freevidcall.com/cppw_app)

 **cppw_bridge** in order to run server, you need to compile and setup bridge first and create "cppw_bridge.conf" file.

-**cppw_server** is example CWServer application demonstrating form input (login) and server push via long polling.
+**cppw_server** is example CWServer application demonstrating form input (login) and server push via long polling. [Live example](http://www.freevidcall.com/cppw_server)

 **cppw_parser** demonstrates HTML parsing and DOM manipulation. This is classic command line program - not a Web application. Just compile it and run from terminal.

-**cppw_widgets** demonstrates using CWWidget classes with Twitter Botstrap theme.
+**cppw_widgets** demonstrates using CWWidget classes with Twitter Botstrap theme. [Live example](http://www.freevidcall.com/cppw_widgets)

 How to compile examples
@@ -274,7 +274,7 @@

 Copy Twitter Bootstrap template from "/templates/" directory to your web server root (apache "htdocs" or "www" directory depending on platform).

-Create "cppw_widgets.conf" in same directory where is you "cppw_widgets.cgi" program and enter path and relative URL to template index.html file. It should look something like this (Linux):
+Create "cppw_widgets.conf" in same directory where is your "cppw_widgets.cgi" program and enter path and relative URL to template index.html file. It should look something like this (Linux):

 ~~~~~~
 TemplatePath=/var/www/templates/bootstrap/index.html
@@ -289,9 +289,6 @@

 Author: Petar Korponaić

-More info at: 
-
-
 [[members limit=20]]

 [[download_button]]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Mon, 25 Nov 2013 21:38:23 -0000</pubDate><guid>https://sourceforge.net3b67f27d591ad46a8ff230cb51ac53329782f29d</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v40
+++ v41
@@ -25,10 +25,10 @@
 --------------------------------------------------
 CppWeb provides two main program classes: CWApp (sessionless application) and CWServer (sessionful application).

-**CWApp** is sessionless application which executes in one-pass: receive and decode request, fire OnRequest() handler, send response and close. You just have to instantiate CWApp and write your own OnRequest() handler.
-
-
-**CWServer** is sessionful application. When executed it continues running waiting for new requests. When idle it can push data to user's browser via ajax (long-polling). You just have to instantiate CWServer and write your own OnRequest() and OnCallback handlers. OnRequest fires when application receives request from user and this is where you generate response page/data. OnCallback fires automaticaly in predefined interval while waiting for request. This is where you can send data back to client (Push).
+**CWApp** is sessionless application which executes in one-pass: receive and decode request, fire OnRequest() handler, send response and close. Session data is stored server side in file and is loaded on next execution. You just have to instantiate CWApp and write your own `OnRequest()` handler.
+
+
+**CWServer** is sessionful application. When executed it continues running waiting for new requests. When idle it can push data to user's browser via ajax (long-polling). You just have to instantiate CWServer and write your own `OnRequest()` and `OnCallback()` handlers. `OnRequest` fires when application receives request from user and this is where you generate response page/data. `OnCallback` fires automaticaly in predefined interval while waiting for request. This is where you can send data back to client (Push).

 * **advantages**: when user starts a session, his CWServer instance is running constantly during session (doesn't start/close on every request). This is useful when your program does time consuming operations on startup or work with complex/slow database queries - initialization is performed only once on first request and open datasets stays open during user session which results in great performance.

@@ -39,14 +39,14 @@
 -----------------------
 CWApp is sessionless application which has "short life": it read request, generate response and close. 

-When executed it decodes CGI variables and cookies and stores request data in **Request** object (class CWRequest).
+When executed it decodes CGI variables and cookies and stores request data in `Request` object (class CWRequest).

 Request object has Query, Post, Cookie and Env members: 

-**Query** stores data received via "GET" method.
-**Post** stores data received via "POST" method.
-**Cookie** stores cookies.
-**Env** member stores CGI environment variables.
+`Query` stores data received via "GET" method.
+`Post` stores data received via "POST" method.
+`Cookie` stores cookies.
+`Env` member stores CGI environment variables.

 You can access request data as easy as this:

@@ -57,9 +57,9 @@
 &amp;nbsp;
 Decoding is performed by excelent [libccgi](http://sourceforge.net/projects/libccgi/) library which is slightly modified and included in source (cppw_ccgi.cpp).

-After CWApp receives and stores request data, it fires **OnRequest** handler which you have to instantiate and write your code to proccess request and generate reponse data.
-
-Member **Response** (class CWResponse) is for sending response to user. It can send html from string or any local file (image, video etc.), can redirect to specified url, set cookies etc.
+After CWApp receives and stores request data, it fires `OnRequest` handler which you have to instantiate and write your code to proccess request and generate reponse data.
+
+Member `Response` (class CWResponse) is for sending response to user. It can send html from string or any local file (image, video etc.), can redirect to specified url, set cookies etc.

 Here is minimal example of OnRequest handler:

@@ -80,21 +80,25 @@
 }
 ~~~~~~
 &amp;nbsp;
-In this example, we read user's IP address from Reguest-&gt;Env (environment variable), create simple HTML page and set Response member. Handler returns "true" which means "no error" and page is sent to client.
+In this example, we read user's IP address from `Reguest-&gt;Env` (environment variable), create simple HTML page and set Response member. Handler returns `true` which means "no error" and page is sent to client.
+
+**Session data**
+
+If you set `CWApp::UseSessionData` member to `true` then you can use `CWApp::SessionData` to keep data which will be available on next request (next execution of CWApp). SessionData is string list object which stores data in form `name=value` which you can access with `SetValue(name, value)` and `GetValue(name)` members. If you are using session data it's recommended to set `CheckCookies` to `true`. In that case CWApp will perform cookie check (redirect) before SessionID is assigned and if client browser doesn't support cookies error message is sent to user.

 Full example is included in "/examples/cppw_app/" directory.

 &lt;a id="cwserver"&gt;&lt;/a&gt;CWServer
 -----------------------------
-CWServer is sessionful application which is executed on first request and stays resident in memory waiting for further request from the same user (until timeout or regulary closed). Every user opens own instance of CWServer application.
-
-Every instance gets it's own SessionID which is sent to user via cookie.
+CWServer is sessionful application which is executed on first request and stays resident in memory waiting for further request from the same user (until timeout or regulary closed). Every user opens its own instance of CWServer application.
+
+Every instance gets its own SessionID which is sent to user via cookie.

 **How it works?**
 In fact, user's request goes through CWBridge which is program between web server and CWServer. When user made request, CWBridge starts, decode request and read SessionID from cookies. If no session ID found it checks if cookies are enabled in user's browser, generates SessionID and starts CWServer with assigned this SessionID. CWBridge is then waiting for response from CWServer. When bridge receives response, It send response to user and closes. CWServer is resident in memory in Idle state. On next user's request, CWBridge starts again, read SessionID cookie and redirect request to corresponding CWServer instance, waits for response, sends it back to user and closes. This circle repeats on every request.

-While server is in idle state waiting for request, it periodicaly fires OnCallback() handler where you can push data to user based on some event. For example, in chat application if OnCallback handler receives incomming message from other user (from other instance of CWServer) it pushes message to user.
+While server is in idle state waiting for request, it periodicaly fires `OnCallback()` handler where you can push data to user based on some event. For example, in chat application if OnCallback handler receives incomming message from other user (from other instance of CWServer) it pushes message to user.

 **Sounds complicated?**
 Maybe sounds complicated, but this process is hidden from you. You just have to instantiate CWServer class and make your own OnRequest() and OnCallback() handlers.
@@ -132,7 +136,7 @@
         url: "/cppw_bridge",
         cache: false,
         data: { "long_polling": "true" },
-    }).done(function( reponse ) {
+    }).done(function( response ) {

         // do something with response
         // ...
@@ -166,7 +170,7 @@
 &lt;a id="cwnode"&gt;&lt;/a&gt;HTML parsing and DOM manipulation
 -------------------------------------------------------------

-Class CWNode is a node of DOM tree. ParseHTML() method parses HTML string and constructs a DOM tree. This is very simple parser implementation which parses only valid well-formed documents (all tags properly closed etc.). CWNode has many DOM manipulation functions such as AddChild, InsertChild, DeleteChild, FindChildByName, FindChildByID etc. Function GetHTML() creates HTML string from DOM tree.
+Class `CWNode` is a node of DOM tree. `ParseHTML()` method parses HTML string and constructs a DOM tree. This is very simple parser implementation which parses only valid well-formed documents (all tags properly closed etc.). CWNode has many DOM manipulation functions such as `AddChild`, `InsertChild`, `DeleteChild`, `FindChildByName`, `FindChildByID` etc. Function `GetHTML()` creates HTML string from DOM tree.

 For example:

@@ -202,13 +206,13 @@
 &lt;a id="cwwidget"&gt;&lt;/a&gt;GUI Widgets
 ================================

-GUIWidgets enables you to write web application in the same way as you write classic desktop application - using widgets and events.
-
-CWWidget is a base class for widget objects such as: CWContainer (HTML "div" element), CWLink (HTML "a" element), CWNav (for navigation and menus, HTML "ul" element), CWNavItem (menu item, HTML "li" element), CWDropdownLink (link with dropdown menu) etc.
+GUI widgets enables you to write web application in the same way as you write classic desktop application - using widgets and events.
+
+`CWWidget` is a base class for widget objects such as: `CWContainer` (HTML "div" element), `CWLink` (HTML "a" element), `CWNav` (for navigation and menus, HTML "ul" element), `CWNavItem` (menu item, HTML "li" element), `CWDropdownLink` (link with dropdown menu) etc.

 CWContainer, CWPageContainer and CWPage can contain more widgets - childs.

-All widgets have two important methods: EventHandler() and Draw(). EventHandler fires when application receives request from user. Event is propagated to all child widgets. When all childs are finished processing event, Draw() method fires for all child widgets currently visible creating DOM structure. Generated DOM structure program converts into HTML and inserts it into template. Template is HTML skeleton that you provide - It's HTML file with empty body in which you can include your custom css files for styling, javascript files etc.
+All widgets have two important methods: `EventHandler()` and `Draw()`. EventHandler fires when application receives request from user. Event is propagated to all child widgets. When all childs are finished processing event, Draw() method fires for all child widgets currently visible creating DOM structure. Generated DOM structure program converts into HTML and inserts it into template. Template is HTML skeleton that you provide - It's HTML file with empty body in which you can include your custom css files for styling, javascript files etc.

 Widgets example is included in "/examples/cppw_widgets/" directory. 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Wed, 09 Oct 2013 21:55:28 -0000</pubDate><guid>https://sourceforge.net0fbebf483df550157fc2c7ee560d8963a0ab6fff</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v39
+++ v40
@@ -16,7 +16,7 @@
 -------------------------------------
 CppWeb is cross-platform C++ library for developing sessionless or sessionful web applications with server push support.

-The library decodes CGI variables and cookies, has support for file uploads, automatic cookie detection, server-push (long-polling via ajax), URL and HTML entity encode/decode functions, HTML parser etc.
+The library decodes CGI variables and cookies, supports file uploads, performs automatic cookie detection, provides URL and HTML entity encode/decode functions, supports server-push (long-polling via ajax), has built-in HTML parser etc.

 CppWeb compiles on Windows, Linux and MacOSX (tested with GNU C++, MingW, MS Visual C++ and Borland C++ compiler) and can run with almost any web server (Apache, IIS, etc.)

@@ -27,7 +27,13 @@

 **CWApp** is sessionless application which executes in one-pass: receive and decode request, fire OnRequest() handler, send response and close. You just have to instantiate CWApp and write your own OnRequest() handler.

+
 **CWServer** is sessionful application. When executed it continues running waiting for new requests. When idle it can push data to user's browser via ajax (long-polling). You just have to instantiate CWServer and write your own OnRequest() and OnCallback handlers. OnRequest fires when application receives request from user and this is where you generate response page/data. OnCallback fires automaticaly in predefined interval while waiting for request. This is where you can send data back to client (Push).
+
+* **advantages**: when user starts a session, his CWServer instance is running constantly during session (doesn't start/close on every request). This is useful when your program does time consuming operations on startup or work with complex/slow database queries - initialization is performed only once on first request and open datasets stays open during user session which results in great performance.
+
+* **disadvantages**: since every user have it's own instance of program running all the time during session, many users at a time can slow down your server performance. So if your application will be used by many users at a time, CWApp is better choice.
+ 

 &lt;a id="cwapp"&gt;&lt;/a&gt;CWApp
 -----------------------
@@ -202,7 +208,7 @@

 CWContainer, CWPageContainer and CWPage can contain more widgets - childs.

-All widgets have two important methods: EventHandler() and Draw(). EventHandler fires when application receives request from user. Event is propagated to all child widgets. When all childs are finished processing event, Draw() method fires for all child widgets currently visible creating DOM structure. Generated DOM structure program converst into HTML and inserts it into template. Template is HTML skeleton that you provide - It's HTML file with empty body in which you can include your custom css files for styling, javascript files etc.
+All widgets have two important methods: EventHandler() and Draw(). EventHandler fires when application receives request from user. Event is propagated to all child widgets. When all childs are finished processing event, Draw() method fires for all child widgets currently visible creating DOM structure. Generated DOM structure program converts into HTML and inserts it into template. Template is HTML skeleton that you provide - It's HTML file with empty body in which you can include your custom css files for styling, javascript files etc.

 Widgets example is included in "/examples/cppw_widgets/" directory. 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Wed, 09 Oct 2013 10:52:54 -0000</pubDate><guid>https://sourceforge.neta9c3d150adbfd99acd75de1327663030a3e1dcbc</guid></item><item><title>Home modified by Petar Korponaić</title><link>https://sourceforge.net/p/cppweb/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v38
+++ v39
@@ -23,7 +23,7 @@

 &lt;a id="sessionless_or_sessionful"&gt;&lt;/a&gt;Sessionless or sessionful
 --------------------------------------------------
-First, decide which kind of Web application you want to make: sessionless or sesionful. CppWeb provides two main program classes: CWApp (sessionless) and CWServer (sessionful).
+CppWeb provides two main program classes: CWApp (sessionless application) and CWServer (sessionful application).

 **CWApp** is sessionless application which executes in one-pass: receive and decode request, fire OnRequest() handler, send response and close. You just have to instantiate CWApp and write your own OnRequest() handler.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Petar Korponaić</dc:creator><pubDate>Mon, 07 Oct 2013 09:10:55 -0000</pubDate><guid>https://sourceforge.netb692bd7fa3bd98dc7a64a42e502676f077a3ff4d</guid></item></channel></rss>