olá pessoal
Os ficheiros contêm muitos erros, mas talvez alguém saiba como corrigi-los.
Não sei se a culpa é minha. killmob ?
<?php
$accountsPath = "C:/Users/MSI/Desktop/Projeto MYTH/Release Server/Release/DataServer/account";
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (empty($_POST['login']) || empty($_POST['password'])) {
die("Brak danych");
}
$login = strtoupper(trim($_POST['login']));
$password = trim($_POST['password']);
if (!preg_match('/^[A-Z0-9]{3,16}$/', $login)) {
die("Niepoprawny login");
}
$firstChar = $login[0];
if (ctype_digit($firstChar)) {
$folder = "etc";
} else {
$folder = $firstChar;
}
$dir = $accountsPath . "/" . $folder;
if (!is_dir($dir)) {
mkdir($dir, 0777, true);
}
$file = $dir . "/" . $login . ".xml";
if (file_exists($file)) {
die("Konto już istnieje");
}
$xml = <<<XML
<?xml version="1.0"?>
<account weekyear="0">
<username>$login</username>
<password>$password</password>
<cash>0</cash>
<alreadyReseted>0</alreadyReseted>
<ban>
<type>0</type>
<date>
<day>0</day>
<month>0</month>
<year>0</year>
<hour>0</hour>
<minute>0</minute>
<second>0</second>
</date>
</ban>
<block>
<password></password>
<unequip>0</unequip>
<trade>0</trade>
<buy>0</buy>
<sell>0</sell>
<autotrade>0</autotrade>
<premium>0</premium>
<speak>0</speak>
<compose>0</compose>
</block>
<token>1010</token>
<access>100</access>
<storage>
<gold>0</gold>
<items>
</items>
</storage>
<insignia>0</insignia>
<charslot>0</charslot>
<position x="0" y="0" />
<unique>0</unique>
<singleGift>0</singleGift>
<daily>
<received>0</received>
<received>0</received>
<received>0</received>
<received>0</received>
<received>0</received>
<received>0</received>
<received>0</received>
</daily>
<water>
<day>359</day>
<total>0</total>
</water>
<divina>
<day>0</day>
<month>0</month>
<year>0</year>
<hour>0</hour>
<minute>0</minute>
<second>0</second>
</divina>
<sephira>
<day>0</day>
<month>0</month>
<year>0</year>
<hour>0</hour>
<minute>0</minute>
<second>0</second>
</sephira>
</account>
XML;
file_put_contents($file, $xml);
echo "<b>Konto utworzone poprawnie</b><br><br>";
}
?>
<!DOCTYPE html>
<html>
<body>
<form method="POST">
Login: <input name="login" required><br>
Hasło: <input name="password" required><br>
<button>Utwórz konto</button>
</form>
</body>
</html>
se alguém quisesse criar novas contas