<html>
<head>
<?php
// Connect etc.
$ausgabe = mysql_fetch_assoc($SELECT) OR die(mysql_error());
?>
<script type=text/javascript>
function erhohen()
{
<?php
$gold = $ausgabe['gold'] + 10;
$holz = $ausgabe['holz'] + 10;
$metall = $ausgabe['metall'] + 10;
?>
document.formular.gold.value='<?php echo $ausgabe['gold'] ?>' + ' Gold';
document.formular.metall.value='<?php echo $ausgabe['metall'] ?>' + ' Metall';
document.formular.holz.value='<?php echo $ausgabe['holz'] ?>' + ' Holz';
<?php
mysql_query("UPDATE Mittelalter SET gold = '$gold', metall = '$metall', holz = '$holz'") OR die (mysql_error());
?>
window.setTimeout("erhohen();" ,1000);
}
</script>
</head>
<BODY onLoad="erhohen()">
<form name=formular>
<input name=gold readonly><br>
<input name=holz readonly><br>
<input name=metall readonly><br>
</form>
</body>
</html>
<head>
<?php
// Connect etc.
$ausgabe = mysql_fetch_assoc($SELECT) OR die(mysql_error());
?>
<script type=text/javascript>
function erhohen()
{
<?php
$gold = $ausgabe['gold'] + 10;
$holz = $ausgabe['holz'] + 10;
$metall = $ausgabe['metall'] + 10;
?>
document.formular.gold.value='<?php echo $ausgabe['gold'] ?>' + ' Gold';
document.formular.metall.value='<?php echo $ausgabe['metall'] ?>' + ' Metall';
document.formular.holz.value='<?php echo $ausgabe['holz'] ?>' + ' Holz';
<?php
mysql_query("UPDATE Mittelalter SET gold = '$gold', metall = '$metall', holz = '$holz'") OR die (mysql_error());
?>
window.setTimeout("erhohen();" ,1000);
}
</script>
</head>
<BODY onLoad="erhohen()">
<form name=formular>
<input name=gold readonly><br>
<input name=holz readonly><br>
<input name=metall readonly><br>
</form>
</body>
</html>
DANKE
Einen Kommentar schreiben: