What I want to do is hide a modal if the modal is not needed.
However with my PHP script I am using the following, what I know will happen. Is that the story will not sure if the modal is hidden, due to for e.g if modal 2 is hidden which $story[2] shows then story[2] will get skiped.
Here is my code
<?php
if((isset($a)) && (!$a==""))
{
$sqlid = "select id from pages WHERE urltitle = '$t'";
$resultid = mysql_query($sqlid) or die ("Error Searching");
$rowid = mysql_fetch_assoc($resultid);
extract ($rowid);
$id=$id;
$stories = array();
$sql = "select * from items ORDER BY modNumb ASC LIMIT 7";
$result = mysql_query($sql) or die ("Sorry we can't find that post");
while ($row = mysql_fetch_assoc($result))
{
$i++;
$stories[$i] = array('html'=>$row["HTML"]);
}
}
elseif($t=="" || $t=="index" )
{
$id=1;
$stories = array();
$sql = "select * from items ORDER BY modNumb ASC LIMIT 7";
$result = mysql_query($sql) or die ("Sorry we can't find that post");
while ($row = mysql_fetch_assoc($result))
{
$i++;
$stories[$i] = array('html'=>$row["HTML"]);
}
}
?>my modals
<!--- START OF MODUAL 1 --->
<?
if ($row["modNumb"] != 2)
<div id="one">
<?
print $stories[1]['html'];
?>
</div>
<!--- END OF MODUAL 1 --->
<!--- START OF MODUAL 2 --->
<div id="two">
<?
print $stories[2]['html'];
?>
</div>
<!--- END OF MODUAL 2 --->
</div>
<!--- START OF MODUAL 3 --->
<div id="three">
<?
print $stories[3]['html'];
?>
</div>
<!--- END OF MODUAL 3 --->
<!--- START OF MODUAL 4 --->
<div id="four">
<?
print $stories[4]['html'];
?>
</div>
<!--- END OF MODUAL 4 --->
<!--- START OF MODUAL 5 --->
<div id="five">
<?
print $stories[5]['html'];
?>
</div>
<!--- END OF MODUAL 5 --->
<!--- START OF MODUAL 6 --->
<div id="six">
<?
print $stories[6]['html'];
?>
</div>
<!--- END OF MODUAL 6 --->
<!--- START OF MODUAL 7 --->
<div id="seven">
<?
print $stories[7]['html'];
?>
</div>
<!--- END OF MODUAL 7 --->
