You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
のようにJSON形式で現在のカウントを返す。 実行される度にDBに登録されているカウンタをインクリメントする。 また、パラメータに「callback=~」がある場合にはJSONPとして返す 分析機能とかはない純粋に訪問者を数えるだけ。 そんなもんにわざわざDB使うなって話もあるけれども、まぁ個人的な練習なのでよし。 で、今回作ったカウンタをzipでまとめたもの→ダウンロード 2: 環境 今回のサーバー環境。 linux MySQL 5系 ghc 6.8.2 で、利用したHaskellのライブラリは以下のとおり。 Network.CGI Database.HDBC Database.HDBC.MySQL Network.CGIはghcなら標準で入ってると思う。 HDBCとHDBC-MySQLはghcでは標準では入ってないので、それぞれインストールする必要がある。 ただし、HDBC-MySQL
This page is under construction. Feel free to help out. If you make substantial edits, please add your name to the authors list at the bottom of this page, so that you can be credited if this is ever published in another medium. This tutorial focuses on CGI and FastCGI programming. For more introductory information, see tutorials, blogs and research and discussion. Introduction This tutorial aims
Network.CGIってのがある(6.6から?). さすがはGHCの標準ライブラリ,でかさは伊達じゃない. 最初は簡単なプログラムから,query=hugahogeというのが含まれていたら"Your query: hugahoge"と出力するだけのもの. {- Main.hs -} import Network.CGI cgiMain :: CGI CGIResult cgiMain = do m <- getInput "query" case m of Just q -> do setHeader "Content-Type" "text/plain; charset = UTF-8" output "Your query:\n" output q Nothing -> do setHeader "Content-Type" "text/plain" output "ERROR
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く