*jancis38* Posted March 19, 2007 Report Share Posted March 19, 2007 Kā var izdarīt piem. tā, lai tiktu iekš admin.php ir jāievada parole, parole ir rakstīta iekš .txt failā, un kad ieraksti pareizu paroli, tad tu tiec iekšā admin.php Kā to var dabūt gatavu? (: Link to comment Share on other sites More sharing options...
Stopp Posted March 19, 2007 Report Share Posted March 19, 2007 http://lv2.php.net/manual/en/language.control-structures.php http://lv2.php.net/manual/en/function.file-get-contents.php http://lv2.php.net/manual/en/reserved.vari....variables.post iisumaa: if ($_POST['parole']==file_get_contents("parole.txt")) { raadam lapu } Garumaa visu veel var papildinaat ar drosiibas chekiem, sesijaam utt Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 20, 2007 Report Share Posted March 20, 2007 un uzrakstam : URLs.../admin/parole.txt ... un arii ejam ieksaa ;) tad jau daudz praatiigaak glabaat to paroli nevis ieksh TXT faila bet ieksh PHP mainiigaa tad kods sanaaks (kaa jau Stopp radija tikai papildinaats) <?php $parole_nofaila='Mana_slepenaa_parole'; ?> un nolasishanas <?php include ('parole.php'); if ($_POST['parole']==$parole_no_faila) { echo 'raadam lapu'; } else { echo 'Ej Prom...'; } ?> Link to comment Share on other sites More sharing options...
hackerman Posted March 20, 2007 Report Share Posted March 20, 2007 (edited) <?php $parole_nofaila='Mana_slepenaa_parole'; ?> <?php if ($_POST['parole']==$parole_no_faila) :) Edited March 20, 2007 by hackerman Link to comment Share on other sites More sharing options...
*jancis38* Posted April 4, 2007 Author Report Share Posted April 4, 2007 varētu lūdzu sīkāk paskaidrot, lai man pielec, lūdzu palīdziet, tas ir ļoti savrīgi! ;/ Link to comment Share on other sites More sharing options...
andrisp Posted April 5, 2007 Report Share Posted April 5, 2007 Kas tev nav skaidrs ? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted April 5, 2007 Report Share Posted April 5, 2007 hackerman --> nu jaa ;) Mainiegajiem protams jaabuut vienaadiem ;) *jancis38* --> Tieshaam koo no visa shii nesaproti ? Gribi lai tev uzraksta preciizi VISU kodu ? Link to comment Share on other sites More sharing options...
*jancis38* Posted April 5, 2007 Author Report Share Posted April 5, 2007 nu es takā visu izmēģināju bet nekas nesanāk, es gribu lai iēējot iekš admin.php viņš pieprasa paroli, lai tiktu uz admina paneli :/ Link to comment Share on other sites More sharing options...
hackerman Posted April 5, 2007 Report Share Posted April 5, 2007 Kur tu aprāvies? Pie paroles ievadīšanas? Pe pārbaudes? Kur tieši? Saki, kas par lietu ;) Parādi savu kodu, pateiksim, kur kļūda. Link to comment Share on other sites More sharing options...
*jancis38* Posted April 5, 2007 Author Report Share Posted April 5, 2007 es jau to kodu izdzēsu, bet bija tā, ka ieiet iekš admin.php un viņš uzreiz automātiski ieiet, jo parole ir ierakstīta *.txt failā, tad sanāk tā, lietotājs ieiet admin.php un viņs jau var pievienot jaunumus, vārdu sakot visu sabojāt... Link to comment Share on other sites More sharing options...
andrisp Posted April 5, 2007 Report Share Posted April 5, 2007 Tu vienkārši kaut ko nepareizi dari. Link to comment Share on other sites More sharing options...
hackerman Posted April 5, 2007 Report Share Posted April 5, 2007 Index.php: http://paste.php.lv/5402 admin.php: http://paste.php.lv/5403 papeeti un uzraksti savu ;) Link to comment Share on other sites More sharing options...
Grey_Wolf Posted April 5, 2007 Report Share Posted April 5, 2007 (edited) Kas saadaa kodaa liekas nesaprotams? Dodu 100% ka visu lipini no gatavam daljaam .... admin.php <?php $useris_no_txt='Administrator'; $parole_no_txt='Password'; $userisx=$_POST['useris']; $parolex=$_POST['parole']; if ($userisx==$useris_no_txt AND $parolex==$parole_no_txt) { // ADMIN FAILA KODS } else { header("Location:logins.php"); } ?> login.php <html> <body> <form method="POST" action="admin.php"> UZERIS <input type="text" name="useris" > PAROLE <input type="password" name="parole" > <input type="submit" value=" NOSPIED MANI " name="submits"> </form> <body> </html> P.S. kamer uzklabinaaju hackerman jau pasteidzaas Edited April 5, 2007 by Grey_Wolf Link to comment Share on other sites More sharing options...
hackerman Posted April 5, 2007 Report Share Posted April 5, 2007 A tev smukāks pieraksts :D Es parasti nelieku tās atkāpes utt :) Link to comment Share on other sites More sharing options...
*jancis38* Posted April 5, 2007 Author Report Share Posted April 5, 2007 a viņš ielaiž pat tad, kad ieraksta nepareizu paroli! :( Link to comment Share on other sites More sharing options...
Recommended Posts