看板 PHP 關於我們 聯絡資訊
我在flash內傳了一個變數Product="HDC"給xml.php ------------------------------------------------------ mySendVars.Product="HDC"; mySendVars.sendAndLoad("http://localhost/xml.php", myReciVars, "POST"); ------------------------------------------------------ 在php內抓flash傳來的變數值給 $prefer, 並且下了sql指令 ------------------------------------------------------ $prefer = $_POST['Product']; $query = "select * from customer where prefer ='" .$prefer . "'"; echo "&prefer="."$query"; ============================================= 此時我可以在flash內 show出 &prefer 的值 --> select * from customer where prefer ='HDC' 但在網頁上echo出來的字串卻是 --> &prefer=select * from customer where prefer ='' 想請問的是為什麼網頁上echo出來的where條件是空的?? 既然回傳正確的值給flash 應該表示我有正確傳值給變數阿!! 麻煩知道的高手 教教我~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.165.15.85 ※ 編輯: ransonasd 來自: 118.165.15.85 (08/09 15:27)
ransonasd :echo $_POST['Product']; 網頁上也是輸出空值= = 08/09 16:04
starjou :$prefer 是 server 端變數,你怎麼在 flash 內秀? 08/09 16:29
ransonasd :我在flash內用sendAndLoad接收傳回來的$ prefer 08/09 16:34 ※ 編輯: ransonasd 來自: 118.165.15.85 (08/09 16:34)
starjou :那你在網頁怎麼秀 echo? 沒有 flash 傳值的部份給他 08/09 16:42
ybite :你怎麼秀echo? @@ 如果你用瀏覽器的話,你要用一個 08/09 17:12
ybite :method="POST"的form傳送才能跑,如果你下?Product=x 08/09 17:13
ybite :的網址的話,這種變數傳遞叫GET,要抓$_GET 08/09 17:14