title: how to make javascript data into Php value?
body: <p>I want to convert my data on javascript to a php value, and my code on script is like this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).on("click", ".open-image", function (e) {
  
  e.preventDefault();
  
  var _self = $(this);
  
  var image = _self.data('img');
  $("#img").val(image);
  $("#img").attr('src',image);
  
  
  
  $(_self.attr('href')).modal('show');
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>as you can see, the data there is the img which i am displaying on the modal, and this is the code:</p>
  
  <pre><code>&lt;div class="modal fade" id="openimage" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
    &lt;div class="modal-dialog"&gt;
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                      &lt;h4 class="modal-title"&gt;&lt;i class="fa fa-envelope-o"&gt;&lt;/i&gt; View Image&lt;/h4&gt;
  
                  &lt;/div&gt;
                  &lt;form action="#" method="post"&gt;
                      &lt;div class="modal-body"&gt;
                          &lt;center&gt;&lt;td width="50" align="center"&gt;&lt;img align="center" src="img" id="img" value="img" class="img-rounded" width="200" height="200"&gt;&lt;/td&gt; 
  
  
                      &lt;/div&gt;
                      &lt;div class="modal-footer clearfix"&gt;
  
                          &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;&lt;i class="fa fa-times"&gt;&lt;/i&gt; Discard&lt;/button&gt;
  
                          &lt;button type="submit" class="btn btn-primary pull-left"&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt; Send Message&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;&lt;!-- /.modal-content --&gt;
          &lt;/div&gt;&lt;!-- /.modal-dialog --&gt;
  </code></pre>
  
  <p></p>
  
  <p>what i want to do is to convert the img to a php value so I want to echo it, as you can see on the modal, i coded it like this:</p>
  
  <pre><code>&lt;img align="center" src="img" id="img" value="img" class="img-rounded" width="200" height="200"&gt;
  </code></pre>
  
  <p>and I want to convert it to php value like $img and make it like this:</p>
  
  <pre><code>&lt;img align="center" src="&lt;?php echo $img; ?&gt;" id="img" value="img" class="img-rounded" width="200" height="200"&gt;
  </code></pre>
  
  <p>how should i do it? hope u understand.</p>