I am trying to show two hidden <div> (lines 54 & 55) depending on the value of a session variable.
I know the "if" statement is working because the alert tests I have do show when the code is run.
The "Viewing all whose payment has NOT been confirmed." should display if the condition is false while the "Viewing all who have been confirmed." should display if the condition is true. However, neither phrase is displayed. Can anyone help me out?
A snippet of my code follows.
<?php
session_start();
if(isset($_SESSION['validUser']))
{
if ($_SESSION['validUser']!= "True")
die("You are not allowed here!!");
}
else
die("You are not allowed here!");
if ($_SESSION['filter'] <> 'N') {
echo "Hello A1";
?>
<script language="javascript">
alert("Hello 1");
document.getElementById("tel1").style.display = "block";
</script>
<?
} else {
echo "Hello A2";
?>
<script language="javascript">
alert("Hello 2");
document.getElementById("tel2").style.display = "block";
</script>
<?
}
if (isset($_POST['update'])) {
// Save the changes
$currentrow = $_SESSION['currentrow'];
// (more php code not shown)
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
</head>
<body >
<form id="orderForm" method="post" >
<div id="tel1" style="display:none">Viewing all whose payment has NOT been confirmed.</div>
<div id="tel2" style="display:none">Viewing all who have been confirmed.</div>
<fieldset>
<legend>About You</legend>
<div class="grid_3">
<input type="text" size="30" maxlength="30" tabindex="1" name="fname" id="fname" />
</div><!-- end .grid_3 -->
<div class="clearb"></div>
<div class="grid_2">
<input type="text" size="30" maxlength="30" tabindex="2" name="lname" id="lname" />
</div><!-- end .grid_2 -->
</form>
</body>
</html>