oldmanstan
March 26th, 2006, 07:44 AM
when i run this code on my server i get weird behavior... this
#! /usr/bin/ruby
require 'cgi'
cgi = CGI.new
cgi_vars = cgi.params
print "Content-type: text/html\n\n"
val1 = cgi_vars['val1']
puts val1
prints whatever i stuck in val1 in the url, however this
#! /usr/bin/ruby
require 'cgi'
cgi = CGI.new
cgi_vars = cgi.params
print "Content-type: text/html\n\n"
val1 = cgi_vars['val1'].to_i
puts val1.to_s
doesn't print anything when i make val1 and integer (the difference is the .to_i and .to_s method calls) i've searched through the documentation and the pragmatic book but i can't find a single reason why this wouldn't work
anybody have any ideas? maybe i'm just slow, or i've been staring at it too long... thanks!
#! /usr/bin/ruby
require 'cgi'
cgi = CGI.new
cgi_vars = cgi.params
print "Content-type: text/html\n\n"
val1 = cgi_vars['val1']
puts val1
prints whatever i stuck in val1 in the url, however this
#! /usr/bin/ruby
require 'cgi'
cgi = CGI.new
cgi_vars = cgi.params
print "Content-type: text/html\n\n"
val1 = cgi_vars['val1'].to_i
puts val1.to_s
doesn't print anything when i make val1 and integer (the difference is the .to_i and .to_s method calls) i've searched through the documentation and the pragmatic book but i can't find a single reason why this wouldn't work
anybody have any ideas? maybe i'm just slow, or i've been staring at it too long... thanks!