Predmet:slanje variable iz php u js i nazad u php
zelimo poslati var_php iz php-a u javascript. U javascript-u var_js promijenimo i posaljemo ju u php
Dali je ovako uredu?
PreuzmiIzvorni kôd (Javascript):<HTML>
<HEAD>
<TITLE>prolaz varijable</TITLE>
</HEAD>
<BODY>
<?php
$var_php = 'php';
echo "php"."</br>";
echo "php variabla:".$var_php."</br>";
?>
<script>
var_js = "<?php echo $var_php; ?>";
document.write("javascript</br>");
document.writeln("js_variabla: ");
document.writeln(var_js);
document.write("</br>");
var_js="javascript";
document.writeln("js_variabla:");
document.writeln(var_js);
document.write("</br>");
</script>
<?php
$var_php="<script>document.writeln(var_js);</script>";
echo "php"."</br>";
echo "php_variabla: ".$var_php;
?>
</BODY>
</HTML>
zivot je moja domovina.