亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? formkit.html

?? TCL的數據庫處理支撐庫及一些示例
?? HTML
字號:
wiki.tcl.tk 
formkit
Updated 2005-12-01 17:20:05 by escargo ▲
The following package uses tclhttpd templates (tml pages)and metakit to store and retrieve web form information. Tclhttpd "proxies" form submissions/requests, thus giving a multiuser and pseudo "acidity" to metakit.
Formkit's main use is to create webforms are sequentially used either to submit information or to display information retrived from a metakit database. Usually, one would create a "nice" looking form in an html editor, and then add the formkit-specific stuff into it.
Also demonstrated is the use of cookies within tclhttpd, wherein the table position is stored and passed around from form to form. The demo provided uses one table per form, although that could be modified, and works under the premise that tables are related through their row position, e.g., "record 5 in table a is related to record 5 in table b".
Note there is minimal error checking, and that the procs could be cleaned up a lot, and the approach used is that a form is either "referred" or "self-posted". If referred, it is either a new entry, or an "edit" thus it should display information based on row position (extracted from the cookie). If self-posted, the form has to write its contents, and re-direct.....
So to run the demo stuff,
Put the pkgIndex and formkit files in tclhttpd's lib or custom dir
Package require formkit
source demo.tcl to create an empty db
Point your browser to the htdocs directory where the index, zero, first and second .tml files reside
Anyway,
hope this is of use, and happy new year
nicolas boretos
pkgIndex.tcl
 package ifneeded formkit 0.1 [list source [file join $dir formkit.tcl]]
end of pkgIndex.tcl
formkit.tcl
 package provide formkit 0.1

 #Boretos, 2002

 namespace eval formkit {
    namespace export *
 }

 proc formkit::lock {db view} {
        #####This HTTP_REFERER stuff really should become a proc of its own####
        if {$::env(HTTP_REFERER) != "[eval join {http://$::env(HTTP_HOST)$::page(url)}]"} {
                        ####Form is refered, so lock record####
                        mk::row append locked.records db $db view $view position  [Doc_Cookie position]
        } else {
                ####Form is self-posted, data has been written, so unlock record#####
                catch {mk::row delete locked.records![mk::select locked.records db $db view $view position [Doc_Cookie position]]}
        }
 }

 proc formkit::init {db view next_page} {
       if {$::env(HTTP_REFERER) == "[eval join {http://$::env(HTTP_HOST)$::page(url)}]"} {
                if {[lindex $::page(query) 1] == ""} {
                        #####Means a new record, so set a table position cookie ####
                        Doc_SetCookie -name position -value  [mk::view size $db.$view]
                        #####Write this record into the locked.records table#####
                        #####It will have to be unlocked in the form_done proc
                        ::formkit::lock $db $view
                        #####mk::row append locked.records db $db view $view position [mk::view size $db.$view]
                        ##### and write the position, thus incrementing the actual table sizefor the next access#####
                        mk::row append $db.$view position [mk::view size $db.$view]
                        #####Redirect to the next page#####
                        Doc_Redirect $next_page
                } else {
                        #####Check to see if desired record exists#####
                        #####This relies on the record position being first in the query data#####
                        if {[expr {[lindex $::page(query) 1] >= [mk::view size $db.$view]}]} {
                                set html ""
                                append html "No Such Record"
                                return $html
                } else {
                                #####Check to see if desired record is locked, if not lock it#####
                                if {[mk::select locked.records db $db view $view position [lindex $::page(query) 1]] == ""} {
                                        mk::row append locked.records db $db view $view position [lindex $::page(query) 1]
                                } else {
                                        set html ""
                                        append html "Record Is Currently Locked, Try Another Record"
                                        return $html
                                }
                        #####Set  a table position cookie###
                        #####The position cookie relies on having the position as the first element
                        #####in the query data, so design page accordingly###
                        Doc_SetCookie -name position -value  [lindex $::page(query) 1]
                        #####Redirect to the next page#####
                        Doc_Redirect $next_page
                                }
                        }
        }
 }

 ####This is used in all subsequent forms/pages excluding the last form

 proc formkit::page {db view next_page} {

        if {$::env(HTTP_REFERER) != "[eval join {http://$::env(HTTP_HOST)$::page(url)}]"} {
                ####Form is refered, lock the record and read values from the db.view to be displayed on the form####
                ::formkit::lock $db $view
                eval mk::set $db.$view![Doc_Cookie position] position [Doc_Cookie position]
                foreach {name value} [mk::get $db.$view![Doc_Cookie position]] {
                        upvar $name $name
                        set $name $value
                        }
        } else {
        ####Form is self-posted, so read the page values, write to the db, and redirect#####
        ####Add for correct display checkbox state and edit (resubmit) the value if necessary####
                foreach i [mk::view info $db.$view] {
                        set before($i) ""
                        }
                eval mk::set $db.$view![Doc_Cookie position] [array get before]
                foreach {name value} $::page(query) {
                set $name $value
                lappend field_values $name $value
                }
        eval mk::set $db.$view![Doc_Cookie position] $field_values
        #####Comment the following if a commit is not desired for every page
        mk::file commit $db
        unset field_values
        unset before
        #####Unlock current record
        ::formkit::lock $db $view
        Doc_Redirect $next_page
        }
 }

 ####This is used in the last form/page

 proc formkit::done {db view next_page unlock_view} {

        if {$::env(HTTP_REFERER) != "[eval join {http://$::env(HTTP_HOST)$::page(url)}]"} {
                ####Form is refered, lock the record and read values from the db.view to be displayed on the form####
                ::formkit::lock $db $view
                mk::set $db.$view![Doc_Cookie position] position [Doc_Cookie position]
                foreach {name value} [mk::get $db.$view![Doc_Cookie position]] {
                        upvar $name $name
                        set $name $value
                        }
        } else {
                ####Form is self-posted, so write the page values, unlock record and redirect#####
                ####Add for correct display of checkbox state and edit (resubmit) the value if necessary####
                foreach i [mk::view info $db.$view] {
                set before($i) ""
                        }
                eval mk::set $db.$view![Doc_Cookie position] [array get before]
                foreach {name value} $::page(query) {
                set $name $value
                lappend field_values $name $value
                }
        eval mk::set $db.$view![Doc_Cookie position] $field_values
        #####Comment the following if a commit is not desired for every page
        mk::file commit $db
        unset field_values
        unset before
        #####Unlock current record
        ::formkit::lock $db $view
        #####Unlock the "main" view that was locked with formkit_init######
        catch {mk::row delete locked.records![mk::select locked.records db $db view $unlock_view position [Doc_Cookie position]]}
        Doc_Redirect $next_page
        }
 }

 #####Helper procs for check/radio box###

 proc formkit::checkbox {db view name value} {
        if {[mk::get $db.$view![Doc_Cookie position] $name] == $value} {return checked}
        }
 proc formkit::radio {db view name value} {
        if {[mk::get $db.$view![Doc_Cookie position] $name] == $value} {return checked}
        }
end of formkit.tcl
demo.tcl
 package require Mk4tcl

 #Open an in-memory file to store locked metakit records

 mk::file open locked

 mk::view layout locked.records {db view position}

 #Open and define our datafile

 mk::file open people people.dat

 mk::view layout people.names {position first last c1 c2}

 mk::view layout people.information {position email notes}
end of demo.tcl
Sample forms
index.tml
 [
 Doc_Dynamic
 ]

 <html>

 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
 <title>Welcome</title>
 </head>

 <body>
 <H3>Enter Record Number to Edit, Or Submit to Add a New Record</H3>
 <form method="POST" action="zero.tml">
  <p><input type="submit" value="Add/Edit a Record" ></p>
 </form>
 </form>

 </body>

 </html>
end of index.tml
zero.tml
 [
 Doc_Dynamic
 ]

 [
 ::formkit::init people names first.tml
 ]

 <html>

 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
 <title>Zero.tml</title>
 </head>
 <body>
 <form method="POST" action="$page(url)">
 <p><input type="submit" value="Add/Edit a Record" ><input type="text" name="position" size="3"></p>
 </form>
 </form>

 </body>

 </html>
end of zero.tml
first.tml
 [
 Doc_Dynamic
 ]

 [
 ::formkit::page people names second.tml
 ]

 [
 puts $page(query)
 ]

 <html>
 <head>
 <title>First.tml</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
 </head>

 <body bgcolor="#FFFFFF" text="#000000">
 <form>
  <p>
    <input type="text" name="position" value="[Doc_Cookie position]"></p>
    <p>
    <input type="text" name="first" value="$first">
    First Name </p>
  <p>
    <input type="text" name="last" value="$last">
    Last Name</p>
  <p>
        <input type="checkbox" name="c1" value="checked"[::formkit::radio people names c1 checked]>OK
        </p>
        <input type="radio" name="c2" value="male" [::formkit::checkbox people names c2 male]>
        male</p>
        <p>
        <input type="radio" name="c2" value="female" [::formkit::checkbox people names c2 female]>
        female</p>
          <p>
    <input type="submit" value="Continue">
  </p>
 </form>
 </body>
 </html>

 <method="post" action="$page(url)">
end of first.tml
second.tml
 [
 Doc_Dynamic
 ]

 [
 ::formkit::done people information index.tml names
 ]

 <html>
 <head>
 <title>Second</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
 </head>

 <body bgcolor="#FFFFFF" text="#000000">
 <form>
  <p>
  <input type="text" name="position" value="[Doc_Cookie position]"></p>
  <p>
    <input type="text" name="email" value="$email" >email</p>
  <p>
  <p><textarea rows="10" name="notes" cols="20">$notes</textarea>notes</p>

  <input type="submit" name="Submit" value="Submit">
  </p>
 </form>
 </body>
 </html>

 <method="post" action="$page(url)">
end of second.tml

Jeff Smith I am having a spot of bother trying formkit. When I do a package require the first time I get "missing close-brace" but thereafter it gives the version. When I do package require on say "html" it gives the version straight away.
 % package require formkit
 missing close-brace
 % package require formkit
 0.1
 % package require html
 1.2
I was wondering if something was missed when you copied and paste to the wiki?
NB I just checked and removed some "garbage" that included a couple of braces. I hope its ok now (it pastes correctly into a shell). BTW, thanks to whoever formatted this page nicely.

[ Category Package | Category Internet | ]

* Home 
* Recent changes 
* Help 
* Edit 
* History 
* References
窗體頂端

窗體底端
窗體頂端

窗體底端
Getting started 
What is Tcl?
What is Tk?
Getting Tcl/Tk
Getting help
Learning Tcl
The Tcl Dev Xchange
About the Wiki
Community 
Advocacy
Conferences
Chat, news, lists
History
Humor
People
Tcl websites
Reference 
Companies
Getting help
Online books
Online tutorials
Manual pages
Tcl roadmap
Acronyms
Tcl software 
Applications
The Tcl core
Development tools
Documentation
Extensions
Toys and games
Tcl in the wild 
Major applications
Businesses
Education
Engineering
Government
Medical
Other
Home ? Recent changes ? Help ? Edit ? History ? References ? Search ? Toggle Menu
DO NOT CLICK THIS LINK. It is a trap for badly behaved bots. If you follow this link, you will be unable to use the site afterwards.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区黑丝| 国产一区二区三区久久久| 日韩欧美高清dvd碟片| 不卡一区二区中文字幕| 日本系列欧美系列| 亚洲精品久久嫩草网站秘色| 亚洲精品一区二区三区精华液 | 免费不卡在线视频| 18欧美乱大交hd1984| 精品欧美久久久| 欧美日韩三级一区二区| 成人免费福利片| 久久99精品国产麻豆婷婷洗澡| 一卡二卡三卡日韩欧美| 中文字幕av在线一区二区三区| 日韩久久免费av| 欧美日韩黄色影视| 色先锋资源久久综合| 成人avav影音| 国产成人自拍高清视频在线免费播放| 亚洲国产成人porn| 国产精品免费视频网站| 久久人人爽爽爽人久久久| 日韩美女视频一区二区在线观看| 欧美视频一区二区| 色婷婷激情一区二区三区| 不卡一卡二卡三乱码免费网站| 国产一区不卡在线| 麻豆成人久久精品二区三区小说| 亚洲成人av福利| 亚洲福利一二三区| 一区二区三区高清| 伊人色综合久久天天人手人婷| 国产精品嫩草99a| 国产精品久99| 欧美极品aⅴ影院| 国产欧美日韩亚州综合| 精品国产一区二区三区忘忧草| 欧美一区二区三区人| 欧美剧情电影在线观看完整版免费励志电影 | 91污片在线观看| 成人高清视频在线观看| 成人听书哪个软件好| 懂色中文一区二区在线播放| 欧美视频在线一区二区三区 | 国产欧美日韩久久| 国产三级欧美三级日产三级99| 久久嫩草精品久久久久| 久久久精品免费观看| 久久精品综合网| 国产精品福利av| 亚洲欧美日韩一区二区 | 国产aⅴ综合色| 成人h动漫精品一区二区| 成人app下载| 91精彩视频在线观看| 欧美精品一二三| 日韩免费成人网| 欧美国产一区在线| 日韩美女久久久| 亚洲亚洲人成综合网络| 热久久国产精品| 黄网站免费久久| 成人网男人的天堂| 欧美亚洲国产一区二区三区| 欧美日韩国产经典色站一区二区三区| 91精品国产综合久久精品性色| 欧美mv和日韩mv的网站| 国产欧美日韩在线| 亚洲一区中文日韩| 老色鬼精品视频在线观看播放| 国产成人av影院| 欧洲一区二区三区在线| 欧美变态口味重另类| 亚洲国产高清aⅴ视频| 亚洲在线视频网站| 狠狠色丁香久久婷婷综合丁香| 国产v日产∨综合v精品视频| 欧美综合欧美视频| 欧美精品一区二区三区高清aⅴ| 国产精品久久午夜夜伦鲁鲁| 亚洲国产精品天堂| 国产成人亚洲精品青草天美| 欧美在线影院一区二区| www日韩大片| 一区二区三区免费| 韩国精品免费视频| 欧洲国内综合视频| 久久久精品2019中文字幕之3| 亚洲精品网站在线观看| 国内成人免费视频| 欧美日韩精品一区视频| 欧美激情中文不卡| 免费高清成人在线| 色婷婷狠狠综合| 久久久亚洲国产美女国产盗摄| 夜夜亚洲天天久久| 成人一级视频在线观看| 日韩欧美美女一区二区三区| 亚洲激情网站免费观看| 国产福利视频一区二区三区| 欧美肥大bbwbbw高潮| 中文字幕中文字幕一区二区| 青青草成人在线观看| 在线观看视频91| 国产精品不卡一区二区三区| 美女视频第一区二区三区免费观看网站| 99久久婷婷国产综合精品| 日韩久久精品一区| 亚洲综合清纯丝袜自拍| av一区二区三区黑人| 精品免费一区二区三区| 天涯成人国产亚洲精品一区av| 91在线云播放| 国产欧美日本一区二区三区| 九九国产精品视频| 日韩一区二区三区四区| 亚洲网友自拍偷拍| 91麻豆国产精品久久| 国产精品久久久久久久第一福利 | 夜夜精品浪潮av一区二区三区| 成人黄色大片在线观看| 久久精品一级爱片| 久久99久久99精品免视看婷婷| 欧美日韩国产首页| 一区二区三区在线观看动漫 | 欧美xingq一区二区| 日韩高清不卡一区| 欧美精品第1页| 亚洲国产日韩a在线播放| 色久优优欧美色久优优| 亚洲欧美视频在线观看视频| 91视频.com| 亚洲欧洲中文日韩久久av乱码| www.日韩在线| 亚洲视频你懂的| 91小视频在线免费看| 亚洲日本乱码在线观看| 91论坛在线播放| 一区二区三区美女| 在线中文字幕一区| 亚洲一区二区三区不卡国产欧美| 欧日韩精品视频| 亚洲国产综合91精品麻豆| 欧洲亚洲国产日韩| 婷婷一区二区三区| 欧美一级片免费看| 伦理电影国产精品| 精品国产网站在线观看| 国产综合色产在线精品| 国产日韩精品一区| www.亚洲人| 亚洲第一激情av| 日韩欧美国产高清| 国产成人免费视频网站| 《视频一区视频二区| 欧洲日韩一区二区三区| 日韩av高清在线观看| 精品国产不卡一区二区三区| 懂色av一区二区三区免费看| 中文字幕日韩一区| 欧美卡1卡2卡| 国产精品1区2区| 亚洲视频 欧洲视频| 欧美人与禽zozo性伦| 国产真实精品久久二三区| 国产精品毛片a∨一区二区三区| 一本色道久久综合亚洲91| 五月激情综合色| 久久人人97超碰com| 一本久久a久久精品亚洲| 日韩二区三区四区| 国产无一区二区| 在线免费不卡电影| 韩国av一区二区三区在线观看| 日韩一区在线播放| 91精品国产综合久久蜜臀| 国产精品888| 亚洲国产精品久久久男人的天堂| 欧美成人激情免费网| 色综合天天综合| 黑人巨大精品欧美一区| 亚洲欧美日本韩国| 日韩午夜激情电影| 91麻豆国产自产在线观看| 美女网站一区二区| 成人欧美一区二区三区黑人麻豆 | 一区二区三区中文字幕电影| 日韩欧美一级二级三级| 91丨国产丨九色丨pron| 久久99精品国产.久久久久| 亚洲女厕所小便bbb| 精品国产成人系列| 欧美日韩精品免费| 9i看片成人免费高清| 国产在线视频不卡二| 亚洲国产精品久久人人爱蜜臀| 亚洲国产电影在线观看| 精品国产髙清在线看国产毛片| 色偷偷一区二区三区|