I have this Javascript function below, where I want to change the display
of a link if the value of a session variable is equal to a certain value.
However, this way I did, it is not working, I still get confused when using Javascript and PHP.
Could someone help?
And would it be possible to do this using PHP only when the user loads the page?
<script language="JavaScript" type="text/javascript">
document.onload=function mostraCampominha() {
var select = <?php echo $_SESSION['aprovado']?>;
var txt = document.getElementById("minha");
txt.style.display = (select.value == 'sim')
? "block"
: "none";
}
</script>