Version franēaise
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] The CGI library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@l...>
Subject: Re: [Caml-list] The CGI library

 >   I“m using the CGI library (developed for Jean-Christophe Filliātre) 
 > in order to receive arguments in a CGI application. I use the 
 > function "parse_args" for parse the CGI arguments. 
 > 
 >   My problem is; I have a CGI application that must send data to 
 > another CGI. How can I send arguments to another CGI? Is this possible 
 > with the CGI library? What function should I use?

There are two possible answers:

1. either  you  just  want  your  first  CGI to  produce  a  web  page
   containing a  link to the second  CGI with arguments;  then the URL
   contains the CGI arguments, in such a way:

	http://www.blah.org/second.cgi?arg1=value1&arg2=value2&...

   where  strings  (arguments  and   values)  must  be  encoded  using
   Cgi.encode.

2. or you want to call the second CGI when running the first one; then
   you must set the according environment variables:
  
   - REQUEST_METHOD="GET"
   - QUERY_STRING="arg1=value1&arg2=value2&..."

   before calling the second CGI (where strings are also encoded using
   Cgi.encode.)  You may  use Unix.create_process_env  to do  this (or
   Unix.execvpe if you don't need to return to the first CGI)
	
Hope this helps,
-- 
Jean-Christophe Filliātre (http://www.lri.fr/~filliatr)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners