0

index.php

<h1>Input the URL of the Video you want:</h1>
<input type="text" name="video" id="video">
<input type="submit" name="submit" value="Submit">
<div id="showvideo"></div>
<script>
    $(document).ready(function() {
        $('#video').change(function() {
            $.ajax({
                type: "GET",
                url: "youtube.php",
                date: {'url' : "$('#video').val()"},
                success: function(data){
                    $('#showvideo').html(data);
                }
            });
        });
    });
</script>

youtube.php

if($_GET['url']){
    $url = $_GET['url'];
    $video = new Youtube($url);
    echo $video->getVideo();
}

URLを渡すと、

「通知: 未定義のインデックス: 41 行目の /Applications/MAMP/htdocs/youtube.php の URL」.

このチュートリアルの指示に従いましたが、正しいはずです....

4

4 に答える 4