Hi,
ich habe folgenden Code vorliegen und möchte, dass der User mit seiner Seitenansicht nach dem Buttonklick wieder ganz nach oben geleitet wird.
Also nach dem Klick auf den Button "Ausbau auf Stufe" soll der User wieder an den Anfang der Seite geleitet werden.
Weiss jemand wie man das realisieren kann?
ich habe folgenden Code vorliegen und möchte, dass der User mit seiner Seitenansicht nach dem Buttonklick wieder ganz nach oben geleitet wird.
PHP-Code:
<?php
if (defined ( "SECURITY" ) == false) {
header ( "Location: http://" . $_SERVER ["SERVER_NAME"] . "/game/?do=build" );
exit ();
}
if ((isset ( $build ) == true) && (buildcondition ( $id, $city ) == true)) {
build ( $id, $city );
header ( "Location: http://" . $_SERVER ["SERVER_NAME"] . "/game/?do=build&city=" . $city . "#" . $id );
exit ();
}
if ((isset ( $cancel ) == true) && (citydetail ( "buildprogress", $city ) != "")) {
cancelbuild ( $city );
header ( "Location: http://" . $_SERVER ["SERVER_NAME"] . "/game/?do=build&city=" . $city . "#" . $id );
exit ();
}
echo "<table width='100%' style='border-width:2px;border-style:solid;border-color:#000000;background-image: url(images/header/build.gif);background-repeat:no-repeat;'>";
echo "<tr>";
echo "<td height='75' valign='top'><a href='?do=info&city=" . $city . "#Bauabteilung'><img src='images/icons/help.png' border='0' title='Hilfe'></a></td>";
echo "</tr>";
$result = mysql_query ( "SELECT `id`, `name` FROM buildings" );
while ( $row = mysql_fetch_assoc ( $result ) ) {
if (buildcondition ( $row ["id"], $city ) == true) {
echo "<form method='post' action='?do=build&city=" . $city . "'>";
echo "<input type='hidden' name='id' value='" . $row[id] . "'>";
echo "<tr>";
echo "<td>";
echo "<a name='" . $row ["id"] . "'></a>";
echo "<table width='100%' bgcolor='" . $bg_color_1 . "' style='border-width:2px;border-style:solid;border-color:#000000;'>";
echo "<tr>";
echo "<td width='100%'>";
echo "<table width='100%' style='border-width:1px;border-style:solid;border-color:#000000;background-image: url(images/backgrounds/table.png);background-repeat:repeat-x;'>";
echo "<tr>";
echo "<td>";
echo "<b>" . $row ["name"] . "</b>";
if (citydetail ( "B" . $row ["id"], $city ) != "0") {
echo " (Stufe ";
echo citydetail ( "B" . $row ["id"], $city );
echo ")";
}
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td align='center'>";
if (buildprogressdetail ( "1", $city ) == $row ["id"]) {
echo "<input type='submit' name='cancel' value='Abbrechen' style='width:200px;font-weight:bold;font-size:9pt;background-color:#FF0000;border-style:groove;border-width:2px;border-color:#FF0000;' OnClick=\"return confirm('Wollen Sie diesen Bau unwiderruflich abbrechen?\\n\\nAchtung: Alle bis dahin verbrauchten Rohstoffe gehen verloren!');\">";
} else {
echo "<input type='submit' name='build' value='Ausbau auf Stufe ";
echo citydetail ( "B" . $row ["id"], $city ) + 1;
echo "' style='width:200px;font-weight:bold;font-size:9pt;background-color:" . $bg_color_2 . ";border-style:groove;border-width:2px;border-color:" . $bg_color_2 . ";'";
if (citydetail ( "buildprogress", $city ) != "") {
echo " disabled";
}
echo ">";
}
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='100%'>";
echo "<table width='100%' bgcolor='" . $bg_color_2 . "' style='border-width:1px;border-style:solid;border-color:#000000;'>";
echo "<tr>";
echo "<td width='10%' align='center'><img src='images/icons/money.png' title='Geld'></td>";
echo "<td width='40%' align='center'><font size='-1' face='Courier'>";
echo buildresource ( "money", $row ["id"], $city );
echo " \$</font></td>";
echo "<td width='10%' align='center'><img src='images/icons/employees.png' title='Arbeiter'></td>";
echo "<td width='40%' align='center'><font size='-1' face='Courier'>";
echo buildresource ( "employees", $row ["id"], $city );
echo "</font></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='10%' align='center'><img src='images/icons/cement.png' title='Beton'></td>";
echo "<td width='40%' align='center'><font size='-1' face='Courier'>";
echo buildresource ( "cement", $row ["id"], $city );
echo " kg</font></td>";
echo "<td width='10%' align='center'><img src='images/icons/food.png' title='Nahrung'></td>";
echo "<td width='40%' align='center'><font size='-1' face='Courier'>";
echo buildresource ( "food", $row ["id"], $city );
echo " kg</font></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='10%' align='center'><img src='images/icons/iron.png' title='Eisen'></td>";
echo "<td width='40%' align='center'><font size='-1' face='Courier'>";
echo buildresource ( "iron", $row ["id"], $city );
echo " kg</font></td>";
echo "<td width='10%' align='center'><img src='images/icons/time.png' title='Dauer'></td>";
echo "<td width='40%' align='center'><b>";
echo secondsintime ( buildduration ( $row ["id"], $city ) );
echo "</b></td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td>";
echo "<table width='100%' height='75' style='border-width:1px;border-style:solid;border-color:#000000;background-color:" . $bg_color_2 . ";background-image: url(images/buildings/" . $row ["id"] . ".png);background-repeat:no-repeat;background-position:center;'>";
echo "<tr>";
echo "<td align='center'>";
if (buildprogressdetail ( "1", $city ) == $row ["id"]) {
$buildprogress = explode ( "|", citydetail ( "buildprogress", $city ) );
echo countdown ( buildduration ( $row ["id"], $city ) - ( $buildprogress ["0"] - time () ), buildduration ( $row ["id"], $city ) );
}
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "</form>";
}
}
echo "</table>";
?>
Weiss jemand wie man das realisieren kann?
Kommentar