hi,
i have a page which shows user details(div1) by default
there will be an admin who enters username and pwd and then a new div(div-layer) is displayed.
also ,a user can edit his data by pressing edit button on which he will be displayed div2 and div1 will be hidden.
mt problem is when i try checking all these one by one they work perfectly except for when i enter admin username and pwd and tell a user to fill in more details and then assume myself as a user and edit the data...at this point when i go back(i mean press back button on mozilla browser)...all my divs are visible(even the div layer which should be visible after admin authentication) irrespective of their display settings.i tried disabling the back button..but mozilla doesn't allow js to modify that.please suggest a solution.
<html>
<head>
<script type = \"text/javascript\">
function hideDiv(which) {
if (which == 1) {
document.getElementById(\"div1\").style.display=\"block\";
document.getElementById(\"div2\").style.display=\"none\";
}
if (which == 2) {
document.getElementById(\"div2\").style.display=\"block\";
document.getElementById(\"div1\").style.display=\"none\";
window.history.forward(1);
}
}
</script>
</head>
<body>
<div id="divedit">
<input value=\"edit\" type=\"button\" name=\"edit\" onClick= \"hideDiv(2);\"/>
.........
</div>
<div id="div1">
........
</div>
<div id="div2">
........
</div>
<div id="div3">
username:<input type="text" name="uname"/></br>
password:<input type="password" name="uname"/>
<input value="submit" type="submit" name="submit"/>
</div>
<div id="layer" class="layer" style="display:<?php if(isset($_POST['submit'])) {echo (($_POST['uname'] =='deepthi' && $_POST['pwd']=='deepthi')? 'block' : 'none'); } else {echo 'none';} ?>;">
.....
<body>
</html>