How to get PHP Var from external js file? However, this variable is the dynamic used in the table. itry this Access PHP var from external javascript file but the data shows the same results
this my js code
$('[id^="device"]').change(function() {
opt = $(this).val();
if (opt=="mikrotik") {
$('[id^="info"]').html('<center><small>Copy Perintah, dan masukan di Terminal Mikrotik : <br> (Silahkan sesuaikan server, password, dan username vpn)</small></center>');
$('[id^="command"]').html('<center><pre> /interface ovpn-client add connect-to='+server+' password=''+password+' user='+username+'</pre></center>');
} else if (opt == "linux") {
$('[id^="info"]').html('<center><small>Copy Perintah, dan masukan di Terminal Linux : </small></center>');
$('[id^="command"]').html('<center><pre>bash <(curl -sSL https://git.io/fjiNM)</pre></center>');
} else if (opt == "windows-old") {
$('[id^="info"]').html('<center> Silahkan ikuti tutorial berikut ini <a href="https://docs.hostddns.us/docs/vpn-remote/tutorial-remote-mikhmon-dengan-vpn-remote/"> https://docs.hostddns.us/docs/vpn-remote/tutorial-remote-mikhmon-dengan-vpn-remote/</a></center>');
$('[id^="command"]').html('');
} else {
$('[id^="info"]').html('<center> Silahkan ikuti tutorial berikut ini <a href="https://docs.hostddns.us/docs/vpn-remote/tutorial-remote-mikhmon-dengan-vpn-remote/"> https://docs.hostddns.us/docs/vpn-remote/tutorial-remote-mikhmon-dengan-vpn-remote/</a></center>');
$('[id^="command"]').html('');
}
});
Note : i will show this on modal inside table list