 <pre><code>$(function(){ $("#changeRank").change(function() { var rankId = this.value; //alert(rankId); //$.ajax({url: "/profile/parts/changeRank.php", type: "post", data: {"mapza": mapza}}); //$("body").load("/lib/tools/popups/content/ban.php"); $.ajax({ type: "POST", async: true, url: '/profile/parts/changeRank.php', data: { 'direction': 'up' }, success: function (msg) { alert('success: ' + JSON.stringify(msg)) }, error: function (err) { alert(err.responseText)} }); }); }); require_once('head.php'); require_once('../../lib/permissions.php'); session_start(); $user = "test"; if($_SESSION["user"] != $user &amp;&amp; checkPermission("staff.fakeLogin", $_SESSION["user"], $mhost, $muser, $mpass, $mdb)) $_SESSION["user"] = $user; echo json_encode($user); </code></pre> <p>This sample code will let echo the username back to the page. The alert should show this.</p>