I want save javascript variable data in php variable

I want to save javascript variable data in the PHP variable. here is the example that I am doing:-

<script>
   var res = "success";
   <?php
       echo ?> document.write('res') <?php;
    ?>
</script>

in this code, I am getting an error. please give me some solution to this problem.



Read more here: https://stackoverflow.com/questions/64943115/i-want-save-javascript-variable-data-in-php-variable

Content Attribution

This content was originally published by Kishan at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: