question about CL-HTTP

Cristina Gema Muñoz Maya <[email protected]> Tue, 27 Jan 2004 11:48:59 +0100
Newsgroups gmane.lisp.cl-http
Message-ID <[email protected]>
Hello!!

        I'm doing an application (Criminal law Course) in CL-HTTP under 
LispWork of Harlequin, but i've a problem. I'm going to show you part of the 
code. I 've a html page, siidepe.html
...........
<FORM ACTION="curso.html" METHOD="POST">
user<INPUT TYPE="text" NAME="NOMBRE" SIZE="10" VALUE="">
password<INPUT TYPE="passwd" NAME="NOMBRE" SIZE="10" VALUE="">
......


         And when i submitted this form, the response function read from a 
file which contain information of the user that do the course (the last page 
visited, what they know about each topic,the pages that are known for them), 
and this information is saved in global variables 
(usuario,clave,pagnum,pagin,tema1,..).And i think this don't work when there 
are 2 o more users using the course. So, can you advice me how can i do what 
i want?.

Note: I 've to use the file, to save the information of the users.



(defun inicio-curso (url stream query-alist)
    (http:bind-query-values (nombre contrasena) (url query-alist)
       (with-open-file (f1 "http:www;cl-http;siidepe;alumnos.txt" :DIRECTION 
:IO :if-does-not-exist nil :if-exists :append)
                                     (file-position f1 :start)
                                     (do* ((name (read f1 nil 'eof) (read f1 
nil 'eof))
                                          (password (read f1 nil 'eof) (read 
f1 nil 'eof))
                                          (nump (read f1 nil 'eof) (read f1 
nil 'eof))
                                          (t1 (read f1 nil 'eof) (read f1 
nil 'eof))
                                          (t2 (read f1 nil 'eof) (read f1 
nil 'eof))
                                          (t3 (read f1 nil 'eof) (read f1 
nil 'eof))
                                          (t4 (read f1 nil 'eof) (read f1 
nil 'eof))
                                          (t5 (read f1 nil 'eof) (read f1 
nil 'eof))
                                          (t6 (read f1 nil 'eof) (read f1 
nil 'eof))
                                          (pagconocidas (read f1 nil 'eof) 
(read f1 nil 'eof))

                                         )
                                         ((or (equalp name 'eof) (and 
(equalp nombre name) (equalp contrasena password)))
                                                  (if (equalp name 'eof)
                                                     (prog2
                                                          (setq usuario 
nombre clave contrasena pagnum 1 pagin (pagina 1) tema1 0 tema2 0 tema3 0 
tema4 0 tema5 0 tema6 0 pconocidas nil)
                                                          (format f1 "~%~S 
~S ~D ~D ~D ~D ~D ~D ~D ~A" nombre contrasena pagnum tema1 tema2 tema3 tema4 
tema5 tema6 pconocidas)
                                                      )

                                                         (setq usuario 
nombre clave contrasena pagnum nump pagin (pagina nump) tema1 t1
                                                            tema2 t2 tema3 
t3 tema4 t4 tema5 t5 tema6 t6 pconocidas pagconocidas)
                                                  )
                                         )

                                      )


       )
         (durante-curso url stream); this function is defined,but i haven´t 
written it

    )
)

(http:export-url #u"/curso.html"
            :html-form
            :response-function #'inicio-curso
            :pathname "http:www;cl-http;siidepe;siidepe.html"
            :expiration '(:no-expiration-header)
            :public t
            :no-cache t
            :language :en
            :keywords '(:cl-http :demo)
                 :documentation "Curso")

Sorry if i don't write very well in English.

Thank you very much.

_________________________________________________________________
Deja tu CV y recibe ofertas personalizadas de trabajo en tu buzón. 
http://www.msn.es/Empleo/