A PHP page I am working on can be loaded in several states, in the default state I need one DIV layer to be visible and another one to not be visible - and vice versa. The script has javascript backup to do the same things, BUT I need the css to work for persons viewing the page with javascript disabled.
The code for the first DIV works fine:
<pre><</pre>div name="MoreDiv" ID="MoreDiv" style="position: absolute;top: 10px; left: 15px; width: 95%; font-size:1.3em;
<?php
if(isset($_GET['page']))
{
$ipi = getenv("REMOTE_ADDR");
$u = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
$page = $_GET['page'];
switch($page)
{
case 404:
{echo '';
break;}
default:
{ ?>
<?php }
break;}
}
else { //
?>visibility:none; display:none;<?php }
?>">
... So you'd think that for the other DIV, that needs to be hidden when the ?page variable is set in the URL, putting the "visibility:none; display:none;" attributes inside the default for the php output would work - a bit like this:
div name="PhotoText" ID="PhotoText" style="position: absolute;top: 15px; left: 15px; width: 400px; font-size:1.3em; background: rgb(0, 0, 0); background: rgba(0, 0, 0, 0.7); padding:10px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; -khtml-border-radius: 10px; <?php
if(isset($_GET['page']))
{$page = $_GET['page'];
switch($page)
{
case "test":
{?>
visibility:none; display:none;
<?php
break;}
default:
{ ?>
visibility:none; display:none;
<?php }
break;}
}
else { //
?><?php }
?>">
And yet for some strange and really bizarre reason the DIV STILL SHOWS!... and it stays visible until the page has fully loaded and the javascript within the "body onload" tag kicks in to hide it. I cannot use the PHP to keep the DIV layer blank for the default URL variable, as there are javascript links which require it to be there in order to load content.... so I need a non-JS way of hiding this layer, but in such a way that JS can be used to make it visible again!!