[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: a problem with a cgi.

Doug Phillips

5/16/2007 4:22:00 PM

> -----Original Message-----
> #!/usr/bin/ruby
>
> require 'proxy1LDAP'
> require 'cgi'
>
> cgi = CGI.new
> account = cgi.params
>
> puts "Content-type: text/plain"
> puts
>
> #cgi.out("text/plain") {
> acc=Proxy1LDAP.new
> acc.connetti
> acc.inserisci(account)
>
> When I run this cgi the web server error is:
>
> /usr/lib/cgi-bin/ruby/accMail1.rb:4:in `initialize': wrong
> argument type Array (expected String) (TypeError), referer:
> http://localhost/prove/mail1LDAP.html
>
> What's the argumenti type error in the initialize method?
> If I run proxyLDAP.rb standalone I have no errors and all
> works well with ldap server.
> Why it doesn't work if I use the cgi?

CGI::params returns an array of the parameters posted to the cgi script.
You'll need to either (a) pass individual elements of the array
concatenated into a string, or (b) handle an array in your initialize
method.