title: PHP code inside jquery not working
body: <p>//My jquery</p>
  
  <pre><code>$(document).ready(function() {
      var form = $('#form1'); // contact form
      var submit = $('#submit1'); // submit button
      var alert = $('.alert1'); // alert div for show alert message
  
  // form submit event
  form.on('submit', function(e) {
      e.preventDefault(); // prevent default form submit
      // sending ajax request through jQuery
      $.ajax({
          url: 'giftcard_check.php', // form action url
          type: 'POST', // form submit method get/post
          dataType: 'html', // request type html/json/xml
          data: form.serialize(), // serialize form data 
          beforeSend: function() {
              alert.fadeOut();
              submit.html('Checking....'); // change submit button text
          },
          success: function(data) {
              alert.html(data).fadeIn(); // fade in response data
              form.trigger('reset'); // reset form
              submit.html('Apply'); // reset submit button text
              var $container = $("#result1");
              var refreshId = setInterval(function()
              {
                  $container.load("result.php?code=&lt;?php echo $variable; ?&gt;");
              }, 500);
          },
          error: function(e) {
              console.log(e)
          }
      });
  });
  });
  </code></pre>
  
  <p>The above code is not working while using php code inside jquery. If iam not using php code its working fine. But i want to send session variables to another page (result.php). How can i solve this. Is there any method.</p>