Due to an obscure system need, when clicking a button, I need to know the IP that triggered the same to direct the correct page. With $_SERVER['REMOTE_ADDR']
I have this information. But how could I pass this on to a JS? More or less this way:
document.getElementById('LIMPAR').onclick = function() {
if ($_SERVER['REMOTE_ADDR'] == 'XXX') {
location.href = '1';
} ELSE {
location.href = '2';
}
}
Testing the logic above, I did not succeed. Any suggestions?