PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<script type='text/javascript'>
if (box is hidden)
show box
update cookie to say box is now visible
else
hide box
update cookie to say box is now hidden
</script>
<body>
<?php
if(cookie for box)
display box
?>
</body>
the cookie is a boolean value. the problem is that when i click a link to show the box, the box does not display because even though i update the cookie to say 'show the box', the php code below has already executed and read to hide the box (if i refresh the page the box will show because the php code reads the updated cookie value).
I understand why it's happening, but can't figure out a solution to combat this. any ideas?