ich wollte mir für ein browser game einen map-editor zusammenschrauben, aber eigentlich handelt es sich mehr um sektoren einer riesigen spielwelt, als um maps.
Code:
<?php
$url = $_POST["url"];
$pw = $_POST["pw"];
if($url=="")
{
echo '
<html>
<head>
</head>
<body>
<form action="editor.php" method="post">
welchen sektor mßuuml;chten sie bearbeiten?<input type="text" name="dat"><br>
passwort:<input type="password" name="pw"><br>
<input type="hidden" name="url" value="edit">
<input type="submit">
</form>
</body>
</html>
';
}
if($pw=="12345")
{
$dat=$_POST["dat"];
if($url=="edit")
{
echo '
<html>
<head>
</head>
<body>
<form action="editor.php" method="post">
<input type="hidden" name="pw" value="12345">
<textarea name="inh" cols="150" rows="100"></textarea>
<input type="hidden" name="url" value="write">
<input type="hidden" name="dat" value="'.$dat.'">
<input type="submit">
</form>
</body>
</html>
';
}
if($url=="write")
{
$dat=$_POST["dat"];
$inh=$_POST["inh"];
$fp=fopen($dat.".map","W");
fwrite($fp,$inh);
fclose($fp);
echo '
<html>
<head>
</head>
<body>
</body>
</html>
';
}
}
?>
die leeren sektoren wurden von diesem script erstellt:
Code:
<?php
$stopA=2;
$stopB=2;
$anzA=0;
$anzB=0;
while($stopA==2)
{
$anzA=$anzA+1;
$anzB=0;
$stopB=2;
while($stopB==2)
{
$anzB=$anzB+1;
if($anzB==99){$stopB=1;}
$fp=fopen($anzA."-".$anzB.".map","w");
fwrite($fp,"NONE");
fclose($fp);
//echo $anzA."-".$anzB.".map<br>";
}
if($anzA==99){$stopA=1;}
}
?>
Lesezeichen