You are sending an AJAX POST request, so use $albumname = $_POST['album']; on your server to get the value. I would also recommend that you write such a query to ensure proper coding:
$.ajax({ type: 'POST', url: 'test.php', data: { album: this.title }, success: function(response) { content.html(response); } });
or in shorter form:
$.post('test.php', { album: this.title }, function() { content.html(response); });
and if you want to use a GET request:
$.ajax({ type: 'GET', url: 'test.php', data: { album: this.title }, success: function(response) { content.html(response); } });
or in shorter form:
$.get('test.php', { album: this.title }, function() { content.html(response); });
and now on your server you can use $albumname = $_GET['album']; . Be careful though with AJAX GET requests, as some of them may be cached. To avoid caching them, you can set the cache: false parameter.
Darin Dimitrov
source share