From 8355c5788f7179a3674ab1121c859530e838bb64 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Thu, 26 Jul 2007 04:23:03 -0400 Subject: [PATCH] added examples/session.sql, metaform: added varname --- examples/session.sql | 13 +++++++++++++ metaform.php | 1 + metaform/main.html | 2 +- session.php | 5 ++++- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 examples/session.sql diff --git a/examples/session.sql b/examples/session.sql new file mode 100644 index 0000000..aa44c5a --- /dev/null +++ b/examples/session.sql @@ -0,0 +1,13 @@ +drop table if exists wfpl_sessions; +create table wfpl_sessions ( + id int unique auto_increment, + session_key varchar(16), + length int, + expires int); + +drop table if exists wfpl_session_data; +create table wfpl_session_data ( + id int unique auto_increment, + session_id int, + name varchar(100), + value text); diff --git a/metaform.php b/metaform.php index e6e4123..6eaa7a8 100644 --- a/metaform.php +++ b/metaform.php @@ -29,6 +29,7 @@ require_once('code/wfpl/format.php'); # see code/wfpl/metaform/template.html for the html templates for these elements $GLOBALS['types'] = array( # type input format sql + 'varname' => array('textbox', 'varname', 'varchar(50)'), 'name' => array('textbox', 'oneline', 'varchar(200)'), 'textbox' => array('textbox', 'oneline', 'varchar(200)'), 'int' => array('textbox', 'int', 'int'), diff --git a/metaform/main.html b/metaform/main.html index fd70d42..df07379 100644 --- a/metaform/main.html +++ b/metaform/main.html @@ -11,7 +11,7 @@

The form name should not contain any capitals or symbols (besides underscore)

-

Form name:

+

Form name: (This is used as the database table name (if any) and the basename of all the files.)

Features

diff --git a/session.php b/session.php index b04ed57..4bbaea9 100644 --- a/session.php +++ b/session.php @@ -18,7 +18,7 @@ # along with wfpl; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# you'll need this file that calles db_connect() +# you'll need this file that calls db_connect() if(!isset($GLOBALS['wfpl_db_handle'])) { if(file_exists('db_connect.php')) { require_once('db_connect.php'); @@ -32,6 +32,9 @@ if(!isset($GLOBALS['wfpl_db_handle'])) { # and these database tables: # create table wfpl_sessions (id int unique auto_increment, session_key varchar(16), length int, expires int); # create table wfpl_session_data (id int unique auto_increment, session_id int, name varchar(100), value text); +# run this command to install/clear the tables: +# mysql DATABASE_NAME < code/wfpl/examples/session.sql +# note: you may need these parameters for mysql: -u USERNAME -p # GLOSSARY # -- 1.7.10.4