I'm new to PHP and JS and I'm currently working on a gym management web app for our project in school. I'm adding a bit of QR functionality that sees if the user is eligible to enter the gym or not by checking if the user has paid. I want to know if it is good to escape PHP code in inline JS, or would it be better to get the id via ajax and store it into a js variable?
</script><script> // ... new QRCode(document.getElementById("qr-code"), "./functions/check_if_paid_qr.php?id=<?php echo $_SESSION["member_id"] ?>"); // ... </script> I'm using qrcode.js btw.