M
music
I have a problem with a ruby script, it doesn't work if I call from a
ajax method.
The script is:
#!/usr/bin/ruby -w
require 'proxy1LDAP'
require 'cgi'
cgi = CGI.new
account = cgi.params
puts "Content-type: text/plain"
puts
acc=Proxy1LDAP.new
acc.connetti
acc.inserisci(account)
acc.disconnetti
If I call from action method of a form it works, but if I call from:
xmlHttp.open("POST", "/cgi-bin/ruby/accMail1.rb", true);
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.setRequestHeader("content-type",
"application/x-www-form-urlencoded");
xmlHttp.send(
"uid=" + escape(field['uid']) +
"&nome=" + escape(field['nome']) +
"&cognome=" + escape(field['cognome']) +
"&codice=" + escape(field['codice']) +
"&password=" + escape(field['password'])
);
passing parameters through send method.
It doesn't work.
ajax method.
The script is:
#!/usr/bin/ruby -w
require 'proxy1LDAP'
require 'cgi'
cgi = CGI.new
account = cgi.params
puts "Content-type: text/plain"
puts
acc=Proxy1LDAP.new
acc.connetti
acc.inserisci(account)
acc.disconnetti
If I call from action method of a form it works, but if I call from:
xmlHttp.open("POST", "/cgi-bin/ruby/accMail1.rb", true);
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.setRequestHeader("content-type",
"application/x-www-form-urlencoded");
xmlHttp.send(
"uid=" + escape(field['uid']) +
"&nome=" + escape(field['nome']) +
"&cognome=" + escape(field['cognome']) +
"&codice=" + escape(field['codice']) +
"&password=" + escape(field['password'])
);
passing parameters through send method.
It doesn't work.