No to chyba byłoby na jakiejś takiej zasadzie. Załóżmy, że jest plik 'new.php'. W nim inputy Login, Hasło, a name dla nich to, np. login i pass.
Chciałbym wiedzieć gdzie dalej są przekazywane te wartości. Do jakiego folderu, do jakiej dokładnej lokalizacji na dysku.
Postaram Ci się to opisać na podstawie kodu, który kiedyś napisałem.
Tutaj jak za pewne widzisz są inputy, których 'name' odnośi do pliku 'newacc.php'
Kod php:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
</head>
<body>
<div style="text-align: justify; padding: 50px;">
<form method="post" action="newacc.php">
Account Number:
<?
$account = rand(100000, 999999);
print '' . $account . ' <input type="hidden" name="account" value="' . $account . '">' . "\n";
?><br>
Nick:<input type="text" name="nick" maxlength="20" /> <p3>(Maksymalnie 20 znaków!)</p3><br>
Password:<input type="password" name="pass" maxlength="10"><p3>(Maksymalnie 10 znaków!)</p3><br>
Płeć:<br><input type="radio" name="sex" value="1" checked> Male <br>
<input type="radio" name="sex" value="0"> Famale <br>
Klasa:<br><input type="radio" name="vocation" value="1" checked> Sorcerer<br>
<input type="radio" name="vocation" value="2" > Druid<br>
<input type="radio" name="vocation" value="3" > Paladin<br>
<input type="radio" name="vocation" value="4" > Knight<br>
<input type="submit" value="Create">
<input type="reset" value="Reset">
</form>
</div>
</body>
</html>
To odpowiada za utworzenie plików w folderach takich jak accounts/players/vip.
Kod php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
</head>
</html>
<center>
<?
function skills($vocation)
{
require('config2.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('config2.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('config2.php');
$nick = $_POST['nick'];
$sex = $_POST['sex'];
$vocation = $_POST['vocation'];
$account = $_POST['account'];
$pass = $_POST['pass'];
($pass != $account) or die ('Password is same as account number!');
($pass != $nick) or die ('Password is same as character name!');
($pass != 'tibia' && $pass != 'lol') or die ('Password is too simple!');
($sex == 0 || $sex == 1) or die ('Zła płeć!');
($vocation >= 1 && $vocation <= 4) or die ('Zła klasa!');
($account >= 100000 && $account <= 999999) or die ('Zły numer konta!');
preg_match("/^[a-zA-Z][a-zA-Z ]*$/", $nick) or die ('Zła składnia nicku!');
preg_match("/^[a-zA-Z0-9]+$/", $pass) or die ('Zła składania hasła!');
!preg_match("/^gm/i", $nick) or die ('Nie jesteś GMem!');
$account_file = "$diraccount/$account.xml";
$player_file = "$dirplayer/$nick.xml";
$vip_file = "$dirvip/$account.xml";
!file_exists($account_file) or die ('Istnieje już konto o takim numerze! Losuj jeszcze raz!');
!file_exists($player_file) or die ("Istnieje już postać o nicku '$nick'!");
$file = fopen($account_file, 'w');
fwrite($file,
'<?xml version="1.0"?>
<account pass="' . $pass . '" type="1" premDays="90">
<characters>
<character name="' . $nick . '"/>
</characters>
</account>');
fclose($file);
$file = fopen($player_file, 'w');
fwrite($file,
'<?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">
<spawn x="' . $spawnx . '" y="' . $spawny . '" z="' . $spawnz . '"/>
<temple x="' . $templex . '" y="' . $templey . '" z="' . $templez . '"/>
<health now="' . $health[$vocation] . '" max="' . $health[$vocation] . '" food="0"/>
<mana now="' . $mana[$vocation] . '" max="' . $mana[$vocation] . '" spent="0"/>
<look type="' . $look[$vocation][$sex] . '" head="20" body="30" legs="40" feet="50"/>
<skills>' . "\n" . skills($vocation) . '</skills>
<inventory>' . equip($vocation) . '</inventory>
<depots>
<depot depotid="1"><item id="2590"><inside><item id="2594"/></inside></item></depot>
<depot depotid="2"><item id="2590"><inside><item id="2594"/></inside></item></depot>
<depot depotid="3"><item id="2590"><inside><item id="2594"/></inside></item></depot>
<depot depotid="4"><item id="2590"><inside><item id="2594"/></inside></item></depot>
<depot depotid="5"><item id="2590"><inside><item id="2594"/></inside></item></depot>
<depot depotid="6"><item id="2590"><inside><item id="2594"/></inside></item></depot>
</depots>
<storage/>
</player>');
fclose($file);
$file = fopen($vip_file, 'w');
fwrite($file,
'<?xml version="1.0"?>
<vips/>');
fclose($file);
print "Konto o numerze $account oraz haśle $pass zostało pomyślnie założone!</br>Możesz się teraz zalogować!</br>";
}
newacc();
?>
</center>
No dobrze. Odpowiada za utworzenie. Aby utworzyło to trzeba wskazać ścieżkę zapisu plików, a więc plik config2.php
Kod php:
<?
//---------------------------- OTS directories --------------------------------
$diraccount = 'E:\xampp\htdocs\poprawka\MazurskiOTS 1.0\data\accounts';
$dirplayer = 'E:\xampp\htdocs\poprawka\MazurskiOTS 1.0\data\players';
$dirvip = 'E:\xampp\htdocs\poprawka\MazurskiOTS 1.0\data\vip';
tutaj dalszy kod odpowiadający za ekwipunek itd.
Chodzi mi o to czy byłaby możliwość podejrzenia właśnie tej ścieżki zawartej w $diraccount, $dirplayer, $dirvip.
Wiem, że z poziomu przeglądarki nie ma możliwości podejrzenia kodu PHP, ale czy jest taka możliwość mając dostęp do bazy danych.