K
kublai khan
I want to set a conditional statement that checks to see if a session
variable has populated. Here's the statement which does not work.
<?php $testval = $_SESSION['TestStr']; ?>
(script type = "text/javascript">
if ((<?php $testval == ""; ?>) &&
(document.cookie.indexOf('Name=User')==-1) {
--- do this ---
}
</script>
This does not work.
However,
(script type = "text/javascript"> alert('(<? echo $testval; ?>)');
</script>
does print the value of $testval.
What am doing wrong?
TIA
KK
variable has populated. Here's the statement which does not work.
<?php $testval = $_SESSION['TestStr']; ?>
(script type = "text/javascript">
if ((<?php $testval == ""; ?>) &&
(document.cookie.indexOf('Name=User')==-1) {
--- do this ---
}
</script>
This does not work.
However,
(script type = "text/javascript"> alert('(<? echo $testval; ?>)');
</script>
does print the value of $testval.
What am doing wrong?
TIA
KK