我如何在不同的页面上检索数据?

时间:2013-06-25 09:04:19

标签: php javascript jquery

我将此视频Blob发送到uploadVideo.php文件,我将如何在uploadvideo.php页面上检索它?

function postVideoToServer(videoblob) {
        var data = {};
        data.video = videoblob;
        data.metadata = 'test metadata';
        data.action = "upload_video";
        jQuery.post("http://mysite.com/uploadvideo.php", data, onUploadSuccess);
    }

更多详情

function postVideoToServer(videoblob) {
    var data = {};
    data.video = videoblob;
    data.metadata = 'test metadata';
    data.action = "upload_video";
    jQuery.post("http://mysite.com/uploadvideo.php", data, onUploadSuccess);
}

在uploadvideo.php上我有这个:

    <?php
    require("connect.php");

    $video = $_POST["video"];
    $up = mysql_query("INSERT INTO video VALUES ('$video')");
    ?>

但它似乎仍然不起作用?我想我做错了什么?

3 个答案:

答案 0 :(得分:2)

$video = $_POST['video'];
$metadata = $_POST['metadata'];
$action = $_POST['action'];

答案 1 :(得分:1)

您可以使用$_REQUEST["key"]

$video = $_REQUEST["video"];
$metadata = $_REQUEST["metadata"]; //test metadata
$action = $_REQUEST["action"]; //upload_video

$_POST["key"]

$video = $_POST["video"];
$metadata = $_POST["metadata"]; //test metadata
$action = $_POST["action"]; //upload_video

检索发送到PHP脚本的数据。

要更多地了解不同的数据检索技术及其在PHP中的比较,请参阅link

答案 2 :(得分:0)

uploadvideo.php:

$video = $_POST["video"];
$metadata = $_POST["metadata"]; //test metadata
$action = $_POST["action"]; //upload_video
...

现在你可以随心所欲地做任何事。