Ajax passing data to php script

Viewed 119318

I am trying to send data to my PHP script to handle some stuff and generate some items.

$.ajax({  
    type: "POST",  
    url: "test.php", 
    data: "album="+ this.title,
    success: function(response) {
        content.html(response);
    }
});

In my PHP file I try to retrieve the album name. Though when I validate it, I created an alert to show what the albumname is I get nothing, I try to get the album name by $albumname = $_GET['album'];

Though it will say undefined :/

4 Answers

$.ajax({
type: 'POST',
url: 'test.php', data: { album: this.title }, success: function(response) { content.html(response); } });

Related