Answers for "assign js var to php"

PHP
3

using js variable in php

<script type="text/javascript">
var abc= 'this is text';
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>
Posted by: Guest on June-10-2020
5

js var to php

<script>
   var res = "success";
</script>
<?php
   echo "<script>document.writeln(res);</script>";
?>
Posted by: Guest on February-10-2020
0

how to use php variable in javascript file

<script>
   var res = "success";
</script>
<?php
   echo "<script>document.writeln(res);</script>";
?>
Posted by: Guest on January-01-1970

Browse Popular Code Answers by Language