Nieuw lid |
|
Op www.pentagram.nl/tarot.php kun je 10 plaatjes aanklikken Het probleem is dat je niet kunt zien wat je nu aangeklikt hebt en wat niet. Dus als ik er op klik moet er een rand overheen komen.
De code is:
<?
include ("connect.php");
?>
<head>
<script>
function setKaart(id) {
var totaal,teller,tjek,value;
totaal = 10;
devalue = "";
for (teller=1;teller<totaal+1;teller++) {
if (document.getElementById('kaart'+teller).value==""&&devalue=="") {
document.getElementById('kaart'+teller).value=id;
devalue = teller;
}
}
if (devalue==totaal) {
document.getElementById('submit').style.display='inline';
}
}
</script>
</head>
<body>
<?
foreach ($_POST AS $name => $value) {
$query = mysql_query("SELECT * FROM tarot where id = '$value' " );
$i=0;
echo "<table><tr><td></td></tr>";
while($obj = mysql_fetch_object($query)){
echo "<tr><td>";
echo $name;
echo "<p>";
echo "<img src='images/tarot/$obj->id.jpg' align='left'>";
echo $obj->kaart;
//echo $obj->omschrijving;
echo "</p></tr></td>";
}
}
echo "</table>";
?>
<form method="post" name="form" action="tarot.php">
<?
$aantal = 10;
$i=0;
for ($i=1;$i<$aantal+1;$i++) {
?>
<input type="hidden" READONLY name="kaart<?=$i?>" id="kaart<?=$i?>">
<?
}
$query = mysql_query("SELECT * FROM tarot ORDER BY RAND()" );
$i=0;
while($obj = mysql_fetch_object($query)){
$i++;
?>
<input type="submit" id="submit" name="submit" style="display:none;">
</form>
<a href="javascript:;" onClick="setKaart('<? echo $obj->id; ?>')"><img src='images/card_back.jpg'></a>
<? } ?>
</body>
</html>
<? include ("connect.php"); ?> <head> <script> function setKaart(id) { var totaal,teller,tjek,value; totaal = 10; devalue = ""; for (teller=1;teller<totaal+1;teller++) { if (document.getElementById('kaart'+teller).value==""&&devalue=="") { document.getElementById('kaart'+teller).value=id; devalue = teller; } } if (devalue==totaal) { document.getElementById('submit').style.display='inline'; } } </script> </head> <body> <? foreach ($_POST AS $name => $value) { $query = mysql_query("SELECT * FROM tarot where id = '$value' " ); $i=0; echo "<table><tr><td></td></tr>"; echo "<img src='images/tarot/$obj->id.jpg' align='left'>"; //echo $obj->omschrijving; } } ?> <form method="post" name="form" action="tarot.php"> <? $aantal = 10; $i=0; for ($i=1;$i<$aantal+1;$i++) { ?> <input type="hidden" READONLY name="kaart<?=$i?>" id="kaart<?=$i?>"> <? } $query = mysql_query("SELECT * FROM tarot ORDER BY RAND()" ); $i=0; $i++; ?> <input type="submit" id="submit" name="submit" style="display:none;"> </form> <a href="javascript:;" onClick="setKaart(' <? echo $obj->id; ?>')"><img src='images/card_back.jpg'></a> <? } ?> </body> </html>
|