メイン サーバ関連【CGI・FCS・XMLSocket etc】
sendAndLoadで値がundefinedになります。 | 投稿するにはまず登録を |
| フラット表示 | 前のトピック | 次のトピック |
| 投稿者 | スレッド |
|---|---|
| buhibuhi | Åê¹ÆNo.39207 投稿日時: 2008-6-19 9:22 |
新米 ![]() ![]() 居住地: 東京 投稿: 7
使用環境:
|
sendAndLoadで値がundefinedになります。 お世話になります。
分からない事があるので、誰か分かる方がいれば教えて下さい。 Flashのフォームに入力した値をCGIに渡して、CGI内でその値の保存と読み込みをして、Flashでその値を受け取りたいのですが「undefined」になってしまいます。 あと値の保存も出来ない状態です。 以下はソースコードです。 宜しくお願いします。 Flash側(flash_cgi.swf) on(press){ System.useCodepage = true; testSLV = new LoadVars(); testSLV.msgTestIn = test_send.text; testLLV = new LoadVars(); testSLV.sendAndLoad("test.cgi",testLLV,"POST"); testLLV.onLoad = function(){ test_load.text = testLLV.msgTestOut; } } CGI側(test.cgi) #!/usr/bin/ruby print "Content-type: text/plain\n\n" require "cgi" require "kconv" cgi = CGI.new #書き込み $KCODE = "sjis" msgTestIn = cgi["msgTestIn"] file = File.open("data.txt","a") file.puts(msgTestIn) file.close #読み込み $KCODE = "sjis" msgTestOut = Array.new n = 0 file = File.open("data.txt","r") file.each_line do |line| line2 = line.chomp msgTestOut[n] = line2 n += 1 end file.close print "msgTestOut=#{msgTestOut}" |
| フラット表示 | 前のトピック | 次のトピック |
| 題名 | 投稿者 | 日時 |
|---|---|---|
| » |
buhibuhi | 2008-6-19 9:22 |
| |
gaienboy | 2008-6-19 10:12 |
| |
obact | 2008-6-20 18:00 |
| |
buhibuhi | 2008-6-22 21:52 |
| |
buhibuhi | 2008-6-22 21:37 |
| |
buhibuhi | 2008-6-22 22:49 |
| |
mayor | 2008-6-23 1:24 |
| |
buhibuhi | 2008-6-23 21:47 |
| |
gaienboy | 2008-6-23 6:06 |
| |
buhibuhi | 2008-6-23 22:00 |
| |
buhibuhi | 2008-6-28 23:53 |
| 投稿するにはまず登録を | |



ログイン


