andrisp Posted November 28, 2006 Report Share Posted November 28, 2006 Stopp, globals on arī ir "ertāk", bet to tak tu nevienam neieteiksi ? hackerman, pamācies nedaudz pamatus. Kā arī paskaties pirmo piemēru iekš http://lv.php.net/fwrite, ar uzsvaru uz šo rindiņu: $somecontent = "Add this to the file\n"; Link to comment Share on other sites More sharing options...
hackerman Posted November 28, 2006 Author Report Share Posted November 28, 2006 Nu es tagad sāku mācīties :) iedošu linku :P http://webtech.lv/php_reference/ Domāju, ka tā ir laba pamācība, pietam vēl latviski :) Link to comment Share on other sites More sharing options...
hackerman Posted November 29, 2006 Author Report Share Posted November 29, 2006 vispar tāds arī būtu noderīgs...Tu ķipa iekš admin CP vari rediģēt failus :) Es zinu tažus skriptus, kas to dara, bet tie skripti var arī izdzēst visu no tava komja ārā :D Ja tiem tiek klāt "ļaundaris" Viens bija NST un otras ja nemaldos PHP FILE MANAGER Ar to īstenība var rediģēt, bet labāk jau būtu atsevišķs kods :P Link to comment Share on other sites More sharing options...
bubu Posted November 29, 2006 Report Share Posted November 29, 2006 Reku te jau tika prasīta tāda lieta: http://php.lv/f/index.php?showtopic=5850 Tu ir dabūjams viss skripts. Link to comment Share on other sites More sharing options...
hackerman Posted November 29, 2006 Author Report Share Posted November 29, 2006 Tur jau var rediģēt tikai konkrētu failu... Kā var izvēlēties jebkuru failu? man ienāca prātā ielikt tur izvēles lodziņu :) Bet katru reizi kad būs jauns fails pielikts man būtu jāpieliek tur klāt tas fails...Nu karoč tur čakars vien sanāktu :P Link to comment Share on other sites More sharing options...
Val Posted November 29, 2006 Report Share Posted November 29, 2006 (edited) Tad uztaisi, lai no formas tiktu nodots ceļš uz failu, ko gribi atvērt... Nolasi vajadzīgos failus no dir'a un tad izdrukā dropdown'ā. Edited November 29, 2006 by Val Link to comment Share on other sites More sharing options...
Val Posted November 29, 2006 Report Share Posted November 29, 2006 Minējums: nesaglabā, jo rakstīšana failā nemaz no uzkodēta? Link to comment Share on other sites More sharing options...
andrisp Posted November 29, 2006 Report Share Posted November 29, 2006 (edited) hackerman, uztaisi nelielu failu browserīti (domāju, te forumā tādi piemēri ir atrodami), ierobežo to, lai tas nevar kāpt augstāk par tevis norādīto direktoriju. Un tad apvieno ar bubu norādītā linka atrodamajiem kodiem. Iekš php manuāļa arī daudz piemēru kā nolasīt direktoriju: - http://lv.php.net/manual/en/ref.dir.php#60982 - http://lv.php.net/manual/en/function.readdir.php (2. piemērs) (piemēros var daudz ko atrast) Savējais, name atribūts nevar būt ar punktu. Edited November 29, 2006 by andrisp Link to comment Share on other sites More sharing options...
Val Posted November 29, 2006 Report Share Posted November 29, 2006 (edited) īzī <?php $filename = "ameno.cfg"; if(isset($_POST['ameno'])) { $h = fopen($filename, 'w'); if($h) { fwrite($h, $_POST['ameno']); fclose($h); echo 'saturs atjaunots!<br />'; } else { echo 'nevar atver failu!<br />'; } } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <textarea name="ameno" cols="55" rows="25"><?php echo file_get_contents($filename); ?></textarea> <br /> <input type="submit" value="save"> <input type="reset" value="cancel"> </form> Edited November 29, 2006 by Val Link to comment Share on other sites More sharing options...
andrisp Posted November 29, 2006 Report Share Posted November 29, 2006 Tev laikam magic_quotes ir ieslēgtas (http://lv.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc). Vai nu izslēdz tās, bet tad atceries, ka tev pašam būs jāeskeipo (http://lv.php.net/manual/en/function.mysql-real-escape-string.php) viss kontents, ko rakstīsi iekš datubāzes. Vai arī pirms ierakstīšanas izmanto http://lv2.php.net/manual/en/function.stripslashes.php. Link to comment Share on other sites More sharing options...
andrisp Posted November 29, 2006 Report Share Posted November 29, 2006 Tā bija tikai piebilde. Un to kā dabūt nost \ arī tev pateicu. Rūpīgāk izlasi. Link to comment Share on other sites More sharing options...
andrisp Posted November 29, 2006 Report Share Posted November 29, 2006 Hmm.. pasaki, ko tev atgriež get_magic_quotes_gpc() fja. Link to comment Share on other sites More sharing options...
andrisp Posted November 29, 2006 Report Share Posted November 29, 2006 Pag, tev divās vietās tiek definēta magic_quotes_gpc direktīva ? - http://lv2.php.net/addslashes Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote ('), double quote ("), backslash (\) and NUL (the NULL byte). An example use of addslashes() is when you're entering data into a database. For example, to insert the name O'reilly into a database, you will need to escape it. Most databases do this with a \ which would mean O\'reilly. This would only be to get the data into the database, the extra \ will not be inserted. Having the PHP directive magic_quotes_sybase set to on will mean ' is instead escaped with another '. Link to comment Share on other sites More sharing options...
Val Posted November 29, 2006 Report Share Posted November 29, 2006 (edited) //neizlasīju pēdējo lapu Edited November 29, 2006 by Val Link to comment Share on other sites More sharing options...
Kaitnieks Posted November 29, 2006 Report Share Posted November 29, 2006 Ieraksti tajaa pashaa htaccess apmeeram shitaa <Files ~ "^tavsfails.cfg$"> Order allow,deny Deny from all </Files> Link to comment Share on other sites More sharing options...
Recommended Posts