1

I have a php script that contains a jQuery script too:

<?php
echo "<img class='PrevIMG' onclick='ShowURL(event)' src= 'http://imageURL'/>
         <script>
            function ShowURL(event){
                var im = event.target.src;
                alert(im);
            }
         </script>"
?>

I echo an image and a jQuery script with php and memorate image's URL into im jQuery variable when I click it. I want to memorate that im variable into a php variable so that I can POST/GET it.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Victor
  • 109
  • 1
  • 14
  • You have to either reload the page or use ajax to send the data back to the server, as that's where PHP happens. – adeneo Dec 13 '14 at 16:09

0 Answers0