mam problem chce zrobic strone w ktorej jest formularz i on ma mi utworzyc nowy plik z rozszezeniem .php
i do niego zapisac dane w formie php. No i w tym problem nie wiem jak to zrobic. Wzorowalem sie z accmakera do ots. zmienialem kod:
no i nic prosze o pomoc.<PLS>
<?php include 'checkunique.php'; require '../config.php'; $delay = "0"; $url = "index.php"; include 'redir.php'; include 'logout.inc'; $_SESSION['page'] = 'addchar.php'; function skills($vocation) { require '../config.php'; $str = ""; for ($id = 0; $id <= 6; $id++) $str .= ('<skill skillid="' . $id . '" level="' . $skill[$vocation][$id] . '" tries="0"/>' . "n"); return $str; } function equip($vocation) { require'../config.php'; $str = ""; for ($id = 1; $id <= 10; $id++) { if ($equip[$vocation][$id-1] != 0) { $str .= ('<slot slotid="' . $id . '"><item id="' . $equip[$vocation][$id-1] . '"'); if ($id == 3) // backpack $str .= ('><inside>' . $bp[$vocation] . '</inside></item>'); else $str .= ('/>'); $str .= ('</slot>' . "n"); } } return $str; } function newacc() { require('../config.php'); // This is the config with paths $nick = $_POST['nick']; $charname = $nick; $sex = $_POST['sex']; $vocation = $_POST['vocation']; $account = $_SESSION['user']; $cookievalue = $cookiename; $city = $_POST['city']; if($sizeacc == "7"){ } else if($sizeacc == "6"){ } else{ ($account >= 100000 && $account <= 999999) or die ('Niepoprawny account number!'); // If not found then Five numbers. } // ($account >= 100000 && $account <= 999999) or die ('Niepoprawny account number!'); // This is the old shit ($_COOKIE[$cookiename] != $cookievalue) or die ('Nie możesz założyć już dzisiaj postaci. Spróbuj jutro.'); $diraccount = $folderacc; $dirplayer = $folderplayer; $account_file = "$diraccount/$account.xml"; $player_file = "$dirplayer/$nick.xml"; $myfile = ''.$folderacc.''.$account.'.xml'; //account file $charfile = ''.$folderplayer.'' . $nick . '.xml'; $_SESSION['msg'] = 'Postać o takim nicku już istnieje.'; } else { //$accno, $charname, $voc, $sex $filedata = $leftbit . '<character name="' . $charname . '" /> ' . $rightbit; $accno = $_SESSION['user']; '<?xml version="1.0"?> <player name="' . $nick . '" account="' . $account . '" sex="' . $sex . '" lookdir="1" exp="' . $exp . '" voc="' . $vocation . '" level="' . $lvl . '" access="0" cap="' . $cap . '" maglevel="' . $mlvl[$vocation] . '" lastlogin="0" promoted="0" banned="0"> <spawn x="' . $sx[$city] . '" y="' . $sy[$city] . '" z="' . $sz[$city] . '"/> <temple x="' . $tx[$city] . '" y="' . $ty[$city] . '" z="' . $tz[$city] . '"/> <health now="' . $health[$vocation] . '" max="' . $health[$vocation] . '" food="0"/> <mana now="' . $mana[$vocation] . '" max="' . $mana[$vocation] . '" spent="0"/> <look type="' . $look[$vocation][$sex] . '" head="0" body="127" legs="0" feet="114"/> <skills>' . "n" . skills($vocation) . '</skills> <inventory>' . equip($vocation) . '</inventory> <depots><depot depotid="1"><item id="2590"><inside><item id="2594"/></inside></item></depot></depots> <storage/> </player>'); $h = '3600'; $time = $t + $h * $new_acc_time; include 'success.php'; } } newacc(); ?> </center>
Z góry THX