Fw: [問題] sendToURL傳值給php失敗?
※ [本文轉錄自 Flash 看板 #1GOM6BoD ]
作者: SouthernSun (撒燈尚) 看板: Flash
標題: [問題] sendToURL傳值給php失敗?
時間: Tue Sep 25 15:47:18 2012
參考網頁
http://ppt.cc/Y65d
我是想在網頁上的flash按鈕按下去後,網頁下方會出現"HELLO"
用這個成功 navigateToURL() 但我不想開啟新視窗..所以改用 sendToURL()
然後就失敗了!! Q_Q
AS3=====
var Server_URL:URLRequest = new URLRequest("Untitled-1.php");
var send_data:URLVariables = new URLVariables();
send_data.userPass = "HELLO";
Server_URL.data = send_data;
Server_URL.method = URLRequestMethod.POST;
sendToURL(Server_URL);//失敗
//成功="=// navigateToURL(Server_URL);
PHP=====
$hello = $_POST['userPass'];
echo $hello;
附註====
網頁遷入Flash
<object
type="application/x-shockwave-flash"
data="b3.swf"
width="700"
height="700">
</object>
網頁一開啟就告訴我
Notice: Undefined index: userPass in L:\..\Untitled-1.php on line 56
按了按紐也一樣沒反應...
然後我swf和php檔都放在同一個資料夾~不懂為什麼會失敗="=
後來我在php裡面放上將值寫入文字檔的功能
$txt2 = fopen("testT2.txt","a");
fwrite($txt2,"$userPass");
fclose($txt2);
沒想到文字檔內確實記錄flash傳過去的值..神奇耶0.0
但不管我flash傳值按鈕怎麼按~網頁一點動靜也沒有,是因為我少了什麼
php頁面更新的function嗎@@?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.40.177.252
※ 發信站: 批踢踢實業坊(ptt.cc)
※ 轉錄者: SouthernSun (114.40.177.252), 時間: 09/25/2012 20:53:02
→
09/25 20:54, , 1F
09/25 20:54, 1F
→
09/25 21:58, , 2F
09/25 21:58, 2F
→
09/25 21:58, , 3F
09/25 21:58, 3F
→
09/25 22:29, , 4F
09/25 22:29, 4F
→
09/25 22:30, , 5F
09/25 22:30, 5F
→
09/25 22:31, , 6F
09/25 22:31, 6F
→
09/25 22:41, , 7F
09/25 22:41, 7F
推
09/25 23:35, , 8F
09/25 23:35, 8F
→
09/25 23:40, , 9F
09/25 23:40, 9F
※ 編輯: SouthernSun 來自: 114.40.177.252 (09/26 01:50)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章