jauninjais Posted April 11, 2006 Report Share Posted April 11, 2006 man ir uztaisiits kods, iisteniiba ljoti ljoti debiils kods, ja skatiit no juusu puses, bet vai juus nevarat ieteikt ko var paarveidot, lai buutu vismaz kaut kaada droshiiba lapai, jo pashlaik lapu ar shaadu kodu, uzlauzt buutu vieglaak par vieglu: kods: http://paste.php.lv/3615 Link to comment Share on other sites More sharing options...
SkyD Posted April 11, 2006 Report Share Posted April 11, 2006 Nu jā, tur security nekāda smaka. Bet skatoties, ko tev tur vajag aizsargāt ar to paroli? Tas ir taka, logins uz admin sistēmu, vai piem. aizsargā kādu failu? Link to comment Share on other sites More sharing options...
axwell Posted April 11, 2006 Report Share Posted April 11, 2006 viņš laikam ar koda aizsardzību domāja to lai netiek uzlauzts viņa admina accounts, nez manuprāt 9 rindiņā tev tur kaut kas īsti nav kā vajag! Link to comment Share on other sites More sharing options...
andrisp Posted April 11, 2006 Report Share Posted April 11, 2006 (edited) Neaizmirsti php.ini (php konfigurācija) failā iestatīt register_globals Off. Ja ir rakstīts ar register_globals ON (protams tikai minējums), tātad, ja padosim xxx.php?pass=1&password=1, tad sekjūrais kontents vairs nebūs sekjūrs. UPD: ja iestatīsi uz Off, tad tev padotajiem datiem būs jāpiekļust ar $_GET un $_POST mainīgajiem. Šajā gadijumā $_GET['action'] un $_POST['pass']. Edited April 11, 2006 by andrisp Link to comment Share on other sites More sharing options...
jauninjais Posted April 12, 2006 Author Report Share Posted April 12, 2006 nu ideja taada, ka peec pareizas paroles ievadiishanas vinsh incluudo to jauna_zinja failu no kurienes var tikt veiktas izmainas lapaa, protams to includoto var arii atveert vnk browserii ieraxtot faila nosaukumu, taapeec ir jautaajums, kaa izbeegt shaadu gadiijumu? Link to comment Share on other sites More sharing options...
v3rb0 Posted April 12, 2006 Report Share Posted April 12, 2006 ielogo session_start(); if(isset($_POST['parole']) && $_POST['parole'] == 'parole') { $_SESSION['loged_in'] = true; } un visos aizsargajamos failos if(!isset($_SESSION['loged_in']) || !$_SESSION['loged_in']) { header('location: not_loged_in.php'); } Link to comment Share on other sites More sharing options...
jauninjais Posted April 12, 2006 Author Report Share Posted April 12, 2006 (edited) aj bljin sesijas veel neesmu maaciijies, bet meegjinaashu tagad saprast shito. a shitas kodam taadam arii jaapaliek, jo man kaut kaa nesanaak, tas ir (admins.php): <? session_start(); ?> <html><head></head><body> <table> <form method="post" action="jauna_zinja2.php"><td>Parole:</td><td><input type="password" name="pass"><input type="submit" value="Ieiet"></td></form></table> </body></html> <?php if(isset($_POST['parole']) && $_POST['parole'] == 'parole') { $_SESSION['loged_in'] = true; } ?> un itka php failaa jauna_zinja2.php vinsh liekas taa: <? if(!isset($_SESSION['loged_in']) || !$_SESSION['loged_in']) { header('location: jauna_zinja2.php'); } ?> <html> ... </html> palabojiet ja stipri kljuudos :( Edited April 12, 2006 by jauninjais Link to comment Share on other sites More sharing options...
Blitz Posted April 12, 2006 Report Share Posted April 12, 2006 otrajam arii jaliek session_start(); kautkur sakumaa Link to comment Share on other sites More sharing options...
v3rb0 Posted April 12, 2006 Report Share Posted April 12, 2006 (edited) failā jauna_zinja2.php darīt header('location: jauna_zinja2.php'); ja useris nav ielogojies ar nevajadzētu.. Edited April 12, 2006 by v3rb0 Link to comment Share on other sites More sharing options...
jauninjais Posted April 12, 2006 Author Report Share Posted April 12, 2006 (edited) es kaut ko nesaprotu, ielieku session_start(); bet firefox man izdot shaadu pazinjojumu: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies. man cookies sanjemshana ir iesleegta Edited April 12, 2006 by jauninjais Link to comment Share on other sites More sharing options...
bubu Posted April 12, 2006 Report Share Posted April 12, 2006 Vai tu neredirektē visu laiku uz sevi? Link to comment Share on other sites More sharing options...
jauninjais Posted April 12, 2006 Author Report Share Posted April 12, 2006 tu domaa to, ka jauna_zinja2.php redirektee uz jauna_zinja2.php, nu jaa tas ir stulbi, es jau vispaar iznjemtu to header, bet tad jau atkal nestraadaa, jo nepareizi buus uzraxtiits. a uz kurieni vinjam jaadirektee tas? pa starpu jaabuut veel vienam failam kursh direktee to no admins.php uz jauna_zinja2.php? Link to comment Share on other sites More sharing options...
Stopp Posted April 12, 2006 Report Share Posted April 12, 2006 kāpēc obligāti kaut kur jādirektē ? Link to comment Share on other sites More sharing options...
jauninjais Posted April 12, 2006 Author Report Share Posted April 12, 2006 man jau nav nekur jaadirektee, bet ja iznjemu to headeri, tad atkal tas pats, kas saakmaa - var ieiet jauna_zinj2.php failaa caur paarluukprogrammas adresi :( Link to comment Share on other sites More sharing options...
Stopp Posted April 12, 2006 Report Share Posted April 12, 2006 izņem redirektu un ieliec session_start(); faila jauna_zinja2.php sākumā, tad varēsi mierīgi pēc tam iet tanī failā no pārlūka. savukārt, ja gribi inklūdot, tad session_start(); nav jāliek, bet tad, accesējot failu no pārlūka (ierakstot adresi pa taisno), sesijas nedarbosies. Link to comment Share on other sites More sharing options...
Recommended Posts