Re: [請益] flash與php間變數的問題
可能說的不是很清楚
我把程式po上來 希望有人可以幫忙我解決~~
以下是我flash內寫的action script
on (release) {
//connect with php
var mySendVars:LoadVars = new LoadVars(); //負責丟資料出去的
var myReciVars:LoadVars = new LoadVars(); //負責接受資料的
mySendVars.Product="DHC";
mySendVars.sendAndLoad("http://localhost/project1_test-widget/ccc.php",
myReciVars, "POST");
myReciVars.onLoad = showText;
function showText():Void {
text3=myReciVars.prefer;
stop();
}
是用post的方式傳值到ccc.php
<?php
$prefer = $_POST['Product'];
$query = "select * from customer where prefer ='" .$prefer . "'";
echo "&prefer="."$query";
?>
flash內的text3有抓到myReciVars.prefer的值
select * from customer where prefer ='DHC'
但我連到http://localhost/ccc.php時 卻只出現
&prefer=select * from customer where prefer =''
為什麼flash內傳回的是對的
直接連到http://localhost/ccc.php
變數值卻不見了
也因為變數值不見 我下的sql就不對 沒辦法連DB
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.165.15.85
→
08/09 19:34, , 1F
08/09 19:34, 1F
→
08/09 19:34, , 2F
08/09 19:34, 2F
→
08/09 19:46, , 3F
08/09 19:46, 3F
→
08/09 19:52, , 4F
08/09 19:52, 4F
→
08/09 21:04, , 5F
08/09 21:04, 5F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 2 之 3 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章