can't pass php variables from php to js in php list plugin

wassy83

New Member
can't understand if this is a bug or I'm doing something wrong but in php list plugin if I insert a code into php box and then insert a js function into the php code I can't pass variables from php to js, this is a simple code that is not working in the php code list plugin

$php = "hello world"; // variable php
echo '<script type="text/javascript">
var php = <?php echo $php; ?>; //pass variable from php to js
alert($php); //show alert dialog
</script>';
exit;

if I quote "<?php echo $php; ?>" then alert box will show <?php echo $php; ?> like a text not the real variable!
is this an issue?
 
I tried the same code in a simple php file in public root of my server, and I have exactly the same issue javascript is working but can't pass the php variables.. so I think that is something with my syntax :( please help I have tried everything!
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top