From: Nicolas B. <ni...@ma...> - 2004-10-07 14:11:15
|
Hi Again 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??? 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... regards, nicolas |