,這是接收表單資料的php控制器,有Form Data資料傳進去了,但是php的$_REQUEST中只有$_GET的資料,沒有$_POST的資料,這是為什嗎?(應該不用看代碼吧?如需看代碼,說一下,我再補上去)
//這是的文本版Remote Address:127.0.0.1:80Request URL:http://localhost/app/index.php?c=member&a=submit&random=0.122100246604532Request Method:undefinedStatus Code:200 OKRequest HeadersAccept:*/*Accept-Encoding:gzip, deflate, sdchAccept-Language:zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4,fr;q=0.2Connection:keep-aliveContent-Length:42Content-type:application/x-www-form-urlencodedCookie:cityId=18; CNZZDATA1252926391=1013903247-1419300217-%7C1421816418; PHPSESSID=3fltaetqosqt69uqj9hd8imr77Host:localhostOrigin:http://localhostReferer:http://localhost/app/index.php?c=makeFactory&a=getVideoFileUser-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4Query String Parametersc:membera:submitrandom:0.122100246604532Form Dataview sourcecontent:0video_id:908price:0label_id:11Response HeadersCache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0Connection:Keep-AliveContent-Length:80Content-Type:text/htmlDate:Sun, 01 Mar 2015 02:50:07 GMTExpires:Thu, 19 Nov 1981 08:52:00 GMTKeep-Alive:timeout=5, max=100Pragma:no-cacheServer:Apache/2.2.17 (Win32) PHP/5.3.3X-Powered-By:PHP/5.3.3
回複內容:
,這是接收表單資料的php控制器,有Form Data資料傳進去了,但是php的$_REQUEST中只有$_GET的資料,沒有$_POST的資料,這是為什嗎?(應該不用看代碼吧?如需看代碼,說一下,我再補上去)
//這是的文本版Remote Address:127.0.0.1:80Request URL:http://localhost/app/index.php?c=member&a=submit&random=0.122100246604532Request Method:undefinedStatus Code:200 OKRequest HeadersAccept:*/*Accept-Encoding:gzip, deflate, sdchAccept-Language:zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4,fr;q=0.2Connection:keep-aliveContent-Length:42Content-type:application/x-www-form-urlencodedCookie:cityId=18; CNZZDATA1252926391=1013903247-1419300217-%7C1421816418; PHPSESSID=3fltaetqosqt69uqj9hd8imr77Host:localhostOrigin:http://localhostReferer:http://localhost/app/index.php?c=makeFactory&a=getVideoFileUser-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4Query String Parametersc:membera:submitrandom:0.122100246604532Form Dataview sourcecontent:0video_id:908price:0label_id:11Response HeadersCache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0Connection:Keep-AliveContent-Length:80Content-Type:text/htmlDate:Sun, 01 Mar 2015 02:50:07 GMTExpires:Thu, 19 Nov 1981 08:52:00 GMTKeep-Alive:timeout=5, max=100Pragma:no-cacheServer:Apache/2.2.17 (Win32) PHP/5.3.3X-Powered-By:PHP/5.3.3
注意到你的Request Method是Undefined,這個地方應該是POST。
你可以:
1、把AJAX提交的方式設定為post
2、最好把表單的method設為post,method="post"
$_POST可以得到資料嘛?還是放上控制器的代碼吧
待補充。