PHP Post请求无法正常运行

时间:2012-06-01 12:35:45

标签: php post

我有一个最奇怪的问题。我使用Ajax请求将数据发送到php页面,该页面将详细信息保存在数据库中以供进一步使用。

每个echo之后的评论是我得到的输出。

$name = $_POST['name'];
$surname = $_POST['surname'];
$message = $_POST['description'];
//$date = $_POST['date'];
$type = $_POST['request_type'];

echo file_get_contents("php://input"); // name=John&surname=Doe&description=Testing&request_type=note

date_default_timezone_set("Africa/Johannesburg");
$time = strtotime("now");

echo "NAME & SURNAME: " . $name . ' ' . $surname; // NAME & SURNAME: 

任何人都可以告诉我为什么它在我echo file_get_contents("php://input");而不是其他地方输出正确的东西?

我很茫然。它永远不会有意义......

编辑1:响应JBTRND。

为了确保您拨打正确的电话,以下是AJAX请求:

$.ajax({
    type:'POST',
    url:"local_code/form_accepted.php",
    data:serialized,
    success:function(response){
        $('#request_type').attr('disabled');
        $('#dialog').html(response);
        $('#docSumbit').html(response);
    }
});

serialized$('#support').serialize();

1 个答案:

答案 0 :(得分:1)

也许你通过$ _GET传递它们?

相关问题