In my code the $vl var is empty. Why?
JS;
<script>
$(document).ready(function(e) {
var vl = "ciao";
});
</script>
PHP:
<?PHP
$vl= "<script>document.write(vl); </script>";
echo "bariabile: ".$vl;
?>
In my code the $vl var is empty. Why?
JS;
<script>
$(document).ready(function(e) {
var vl = "ciao";
});
</script>
PHP:
<?PHP
$vl= "<script>document.write(vl); </script>";
echo "bariabile: ".$vl;
?>
This simply wont work, do try to read a few more tutorials and references for both php and javascript.
Solved:
Hs:
<script>
$(document).ready(function(e) {
var vl = "ciao";
window.location.href = "TEST_YT.php?nm=" +vl;
});
</script>
PHP:
?PHP
$vl= "<script>document.write(vl); </script>";
echo "bariabile: ".$_GET['nm'];
?>