Hi, I'm trying to implement hidden content for a site in php.
PHP looks like this
PHP Code:
for($i=0; $i<$num_rows_publication; $i++)
{
echo ("<a href=\"javascript:unhide('content')\">" . mysql_result($result_publication, $i, "pubName") . "</a>");
$query_files = "SELECT * FROM files WHERE pubId = " .
mysql_result($result_publication, $i, "id") . " ORDER BY files.language";
$result_languages = mysql_query($query_files) or die(mysql_error());
$num_rows_languages = mysql_num_rows($result_languages);
for($j=0; $j<$num_rows_languages;$j++)
{
echo("<div id='content' class='hidden'>");
echo("<table>");
echo("<tr><td class='language'><a href='" . mysql_result($result_languages, $j, "file") . "'>" . mysql_result($result_languages, $j, "language") . "</a></td></tr>");
echo("</table>");
echo("</div>");
}
echo("<hr/>");
}
So Ive got a heading and use that as a link to hide/show results from the database.
Javascript fot that is:
<script type="text/javascript">
function unhide(divID) {
var item = document.getElementById(divID);
if (item) {
item.className=(item.className=='hidden')?'unhidde n':'hidden';
}
}
</script>
and two classes hidden/unhidden.
It doesnt really work and im having big problems trying to implement this in the php areas.
Any suggestions?