From: Colin M. <co...@ch...> - 2004-10-07 14:24:35
|
On Fri, 2004-10-08 at 00:09, Nicolas Boretos wrote: > Is there any simple or built-in way in tclhttpd for checking your page > flow, meaning verify that you got to a page from another??? Not that I know of, but it would be a cool project. What you want (I think) is to drive each user's interaction from a state machine. Their session starts in state 0, then depending on the inputs they submit, it moves to a different state. You define a FSM (aka DFSA) which determines which transitions are legal. There's a tcllib FSM package. Could be useful for this kind of thing. > currently doing cludges like the following.. > > if {[string match "$::env(HTTP_REFERER)" > "http://$::env(HTTP_HOST)/rubia/parts.tml?record_id=[ncgi::value > record_id]&rec_id=[ncgi::value rec_id]&session_id=[ncgi::value > session_id]&use_name=[ncgi::value use_name]"]} { > rubia::populate_checkboxes month_collected [ncgi::value record_id] > month_collected session_id [ncgi::value session_id] use_name > [ncgi::value use_name] > rubia::populate_checkboxes month_traded [ncgi::value record_id] .blahhhhhh > > Or how to check whether form is referred or self posted...?? > > proc rubia::is_self_posted {} { > if {$::env(REQUEST_URI) != "[eval join > {http://$::env(HTTP_HOST)$::page(url)}]"} { > ####Form is refered, so lock record#### > return 0 > } else { > ####Form is self-posted, write data etc > return 1 > } > } > > or the inverse... > > proc rubia::is_referred {} { > if {$::env(HTTP_REFERER) != "[eval join > {http://$::env(HTTP_HOST)$::page(url)}]"} { > ######## > return 1 > } else { > ####Form is self-posted, write data etc > return 0 > } > } > > This used in the .tml pages to decide what action to take ... > if {[rubia::is_self_posted]} { do someting... > > This gets painfull after a while... Word. -- Colin McCormack <co...@ch...> |