title: redirect page using ajax & jquery (php)
body: <p>i want to redirect from page a to page profile and in between there is a post session on them. in this case let's say the data is variable <code>$name</code> in string. so far my code is like this on page a </p>
  
  <pre><code>            jQuery("#result").on("click",function(e){ 
              var $clicked = $(e.target);
              var $name = $clicked.find('.name').html();
              var decoded = $("&lt;div/&gt;").html($name).text();
              $('#searchid').val(decoded); 
              //the ajax script    
              $.ajax({
              type: 'POST',
              url: 'b.php',
              data: 'result='+$name,
              success: function() {
                 window.location.href = "profile.php";  // replace
              }
              });      
              });  
  </code></pre>
  
  <p>and on <code>page b</code> the code is:</p>
  
  <pre><code>&lt;?php echo $_POST['result']?&gt;  
  </code></pre>
  
  <p>the outcome should be the value from <code>result</code> in which determined on <code>page a</code>.
  but so there is an error message saying <code>unidentified index</code>. so where am i doing wrong?</p>