作者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檔都放在同一個資料夾~不懂為什麼會失敗="=
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.40.177.252
※ 編輯: SouthernSun 來自: 114.40.177.252 (09/25 15:48)
※ SouthernSun:轉錄至看板 PHP 09/25 20:53
1F:推 scars:看起來是你php裡用到 $_POST['userName'] 可是swf沒傳進去 09/25 21:00
2F:→ SouthernSun:喔喔~那個其實是其中之一..我省略了其他行 09/25 21:11
3F:→ SouthernSun:我修改一下以免造成誤會@@ 09/25 21:13
※ 編輯: SouthernSun 來自: 114.40.177.252 (09/25 21:13)
※ 編輯: SouthernSun 來自: 114.40.177.252 (09/25 22:41)