#! /usr/local/bin/ruby ref = ENV['HTTP_REFERER'] print "Content-type: text/html\n\n" print <<END <html> <head> <title>リンク元取得・表示</title> </head> <body> リンク元<br> #{ref}<br> </body> </html> END exit