691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
|
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
|
-
+
|
(let ((newresult (cons (string-append (s:any->string key) "=" (s:any->string val))
result)))
(if (< (length tail) 1) ;; true if done
(string-intersperse newresult "&")
(loop (car tail)(cadr tail)(cddr tail) newresult))))))
(define (session:link-to self page params)
(let* ((server (if (get-environment-variable "HTTP_HOST")
(let* ((server (or (get-environment-variable "HTTPS_HOST") ;; Assuming HTTPS_HOST is only set if available
(get-environment-variable "HTTP_HOST")
(get-environment-variable "SERVER_NAME")))
(force-script (sdat-get-script self))
(script (or force-script
(let ((script-name (string-split (get-environment-variable "SCRIPT_NAME") "/")))
(if (> (length script-name) 1)
(string-append (car script-name) "/" (cadr script-name))
|
750
751
752
753
754
755
756
757
758
759
760
761
762
763
|
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
|
+
+
|
"\r")
"\\r")
res)) ;; should return #f if not a string and can't escape it?
(else (if (string? res)
(s:html-filter->string res '())
res)))))
;; params are stored as list of key=val
;;
(define (session:get-param self key type-params)
;; (session:log s:session "params=" (slot-ref s:session 'params))
(let* ((params (sdat-get-params self))
(res (session:get-param-from params key)))
(session:apply-type-preference res type-params)))
;; This one will get the first value found regardless of form
|