title: Post data to another php page using ajax
body: <p>I use the Fullcalendar (javascript). When you click on the event it opens a form with its content.</p>
  
  <pre><code>eventClick: function(calEvent, jsEvent, view) {   
  
  content.val(calEvent.content); //content of event
  $('#event').show(); 
  formOpen('edit');
  
  },
  </code></pre>
  
  <p>I want to do that when you click on the event its opens another php page and displayed its data in it. For now i am trying to just send "hello" string to PAGE2. </p>
  
  <pre><code>eventClick: function(calEvent, jsEvent, view) {             
  
  var content = "hello";
  
  $.ajax({
  
      type:'POST',
      cache: false,
      dataType: "text",
      url: "page2.php?id=&lt;?php echo $_SESSION['id']?&gt;",
      data: { content: content },
  
      success: function(data){
         location.href = 'page2.php?id=&lt;?php echo $_SESSION['id']?&gt;';
      },  
  });
  },
  </code></pre>
  
  <p>PAGE2</p>
  
  <pre><code>$content = $_POST['content']; 
  echo $content;
  </code></pre>
  
  <p>In browser, i see that when you click on an event it performed POST request on PAGE2 with FORM DATA: content:hello. Then there is a transition to PAGE2 and some GET requests without data. And on the PAGE2 i see the error: Undefined index: content.</p>
  
  <p>I spent so many days trying to solve this problem, but have not found a solution. Please, help me to understand where the error is. </p>