PDA

View Full Version : problems combination php and switch content script



josdemosselman
02-04-2010, 11:17 AM
Hello all. I'm kinda new on this forum, so I hope you can help me. I'm having some problems with this switch content script in combination with php


http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

The script tells me that i have to use unique ID to have it properly working. In combination, I use a phpvariable with a counter to have it unique, even put text in there but it doesn't work.
I followed the javascript code, put an external link but it doesn't work. Now, if I put the example code in the page, without php, it does work. Can someone help me with this one. thanks a lot!!!

I select a group from a database, and in every group there are multiple logins and passwords available.



<?php
$type=mssql_query("SELECT Tech_id FROM TableGROUP BY Tech_id;");

echo "<table style='width:100%;'>";
$j=0;
while($row = mssql_fetch_assoc($type))
{
$j++;
$i=1;
$variabele = $row['Tech_id'];
$toep=mssql_query("SELECT * from Table
where Tech_id = '$variabele'
AND Actief='1' order by Toepassing;");

echo "<table border='1' style='width:100%;'>";
echo "<tr>";
echo "<td colspan='4'style='background-color:#2F4F4F; color:#ffffff;text-decoration:underline;'>";
echo "<div class=\"handcursor\" id=\"bobcontent$j-title\">$variabele</div>";
echo "</td>";
echo "</tr>";
echo "<div class=\"switchgroup1\" id=\"bobcontent$j\">";
while($row = mssql_fetch_assoc($toep))
{
if($i==1){
echo "<tr style=\"background-color:#778899; color:white;\">";
echo "<td width='32%'>Application</td>";
echo "<td width='32%'>Login</td>";
echo "<td width='32%'>Password</td>";
echo "<td width='3%'></td>";
echo "</tr>";
echo "<tr>";
$i=0;
}
echo "<td>{$row['Toepassing']}</td>";
echo "<td>{$row['Login']}</td>";
echo "<td>{$row['Paswoord']}</td>";

echo "</tr>";
}
echo "</div>";
echo "</table>";
}

echo "</table>";

mssql_close();


?>

josdemosselman
02-05-2010, 12:41 PM
I've solved the problem, problems with the table tags. They do not work in combination with the script.