title: How can i get php variable data from ajax response data
body: <p>i have a program where i post data by radio button and send it to a php page by jquery ajax function . I want to get variable data from this page so that i can use it in my page from where i send the data . can anyone help me </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function getDesign() {
      var radioValue = $("input[name='metal']:checked").val();
      $.ajax({
          type: "POST",
          url: "&lt;?php echo SITE_URL; ?&gt;image_filter.php",
          data:'metal='+radioValue,
          success: function(data){
              //$("#desc2").html(data);
              alert(data);
          }
      });
  }
  &lt;/script&gt; 
  &lt;?php
      $metal = $_POST['metal'];
      $finish = $_POST['finish'];
      echo $metal;
  ?&gt;
  </code></pre>
  
  <p>i want to use the metal variable in my main page</p>