0

So I get this error on my page:

Notice: Undefined index: url in /mnt/studentenhomes/brent.heynsmans/public_html/RMD/Taak-Rich-Media/index.php on line 14

i know that this code gives me that error

<?php
$playlist = $_GET['url'];
?>
<script>
var my_fn = function(callback) {   // <-- this is callback to be called later
var jax = [];
$.ajax({
    url: "<?php echo $playlist ?>",
    dataType: "xml",
    success: function (data) {
        var song = $(data).find('key').filter(function () {
            return $(this).text().indexOf('Name') != -1;
        }).each(function() {
            var content = $(this).next('string').text();
            jax.push(content);
        });
        callback(jax);   
    }
});

};

how do i fix this?

Brent
  • 43
  • 9

1 Answers1

2

You can fixed this by:

<?php
$playlist = isset($_GET['url']) ? $_GET['url'] : 'default value';
?>
Brotheryura
  • 1,158
  • 13
  • 21