This won't be possible directly. PHP is server-side. It runs and the page finishes execution whereas JavaScript is client-side.
The way to solve your problem would be to make an Ajax request after the page loads with the JavaScript variable. However, having said that, if you already know the JavaScript value, just replace it in the PHP code.
This won't be possible directly. PHP is server-side. It runs and the page finishes execution whereas JavaScript is client-side.
The way to solve your problem would be to make an Ajax request after the page loads with the JavaScript variable. However, having said that, if you already know the JavaScript value, just replace it in the PHP code.
yes i think it needs ajax, and of i of course i don;t know the javascript value so i can't replace it with the php code..the value is generated with html form or variable of javascript..
But my issue now is because i'm using framework php (codeigniter), than i can't just put the ajax into the php code, there's a rule of framework..
Comment