I can't read my POST HTTP request's body with PHP !

前端 未结 3 1295
青春惊慌失措
青春惊慌失措 2020-12-06 16:40

I\'ve never used PHP but right now, I need to write a PHP file that displays in a log file the content of the body of a POST HTTP request.

I\'ve read that you can ac

3条回答
  •  醉酒成梦
    2020-12-06 17:12

    The global variable is $_POST, not _POST. Also it might be that you are sending the data via GET method, in which case you need to use the $_GET global variable.

    If you want to check for either POST or GET method, you can use the global variable $_REQUEST. Sample code bellow:

    
    
    

    file postdata.php:

提交回复
热议问题