http://localhost/test.cgi?type=1
とかでtypeの値「1」を取り出す。

(test.cgi)
#!/usr/local/bin/ruby
require "cgi"

$cgi = CGI.new()
type=$cgi["type"]

typeを数値として判定したいときは to_i を使って。 
最終更新:2007年05月16日 16:27