Ruby/CGI/CGI

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

A Basic CGI Script

#!/usr/bin/ruby
puts "Content-type: text/html\n\n"
puts "<html><body>This is a test</body></html>"
 
If you called this script test.cgi then visiting http://www.example.ru/test.cgi



Writing CGI Scripts

#!/usr/bin/ruby 
print "Contenttype: 
text/html\r\n\r\n" 
print "<html><body>Hello World! It"s #{Time.now}</body></html>\r\n"