First. a consideration. of what this:
<?php
$album=$_GET['album'];
$id=$_GET['ntf'];
?>
It should be at least this:
$album = ( isset( $_GET['album'] ) ? $_GET['album'] : 0 );
$id = ( isset( $_GET['ntf'] ) ? $_GET['ntf'] : 0 );
Now, regarding your problem, AJAX is a technique for making asynchronous requests to a resource located from a given URI.
From what you can tell from your example, what do you expect to happen if the requested page were the same page you are ordering? So:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type='text/javascript' src='http://code.jquery.com/jquery-compat-git.js'></script>
<?php
$album = ( isset( $_GET['album'] ) ? $_GET['album'] : 0 );
$id = ( isset( $_GET['ntf'] ) ? $_GET['ntf'] : 0 );
?>
<script type="text/javascript">
$( function() {
$.ajax({
type: "GET",
url: "test.php",
data: { album: <?php echo $album; ?>, id: <?php echo $id; ?> },
}).done( function( data ) {
$( "#result" ).html( data );
});
});
</script>
</head>
<body>
<div id="result"> Carregando <img src="css/images/gif.gif" width="16" height="16" alt="Loading..." /></div>
</body>
</html>
Whether for extra credit or pure curiosity you will go dozens of requests in the Network / Network tab of your browser or extension to the part if you have nothing native (Firebug).
What you should do is separate PHP into a / URI file and JS that will consume it in another. For example:
index.php
$album = ( isset( $_GET['album'] ) ? $_GET['album'] : 0 );
$id = ( isset( $_GET['ntf'] ) ? $_GET['ntf'] : 0 );
echo json_encode( array( 'album' => $album, 'id' => $id ) );
index.html
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type='text/javascript' src='http://code.jquery.com/jquery-compat-git.js'></script>
<script type="text/javascript">
$( function() {
$.ajax({
type: "GET",
url: "index.php",
dataType: 'json',
data: { album: 10, ntf: 20 },
}).done( function( data ) {
$( "#result" ).html( 'Album: ' + data.album + '. ID: ' + data.id );
});
});
</script>
</head>
<body>
<div id="result"> Carregando <img src="css/images/gif.gif" width="16" height="16" alt="Loading..." /></div>
</body>
</html>
So, when the Request is successfully completed the contents of the DIV will be updated to, in this example, Album: 10 ID: 20