Snaip3Rs Posted March 18, 2011 Report Share Posted March 18, 2011 (edited) Vai šis skripts ir droš? Jo pēc manām domām nepārāk! Un jūs varētu parādīt paraugu kā var uztaisīt tā lai pēc 3 mēģinājumiem nobloke IP un to saglabā db un vairs nepielaiz pie saita! <?php $password = "*****"; ?> <?php print "<h2 align=\"center\">Saits</h2>"; // Ja parole ir pareiza lietotajs tiek pielaists pie lapas if (isset($_POST["password"]) && ($_POST["password"]=="$password")) { ?> <!-- Slepta lapa --> <!-- Beigas sleptas lapas --> <?php } else { // Nepareizas paroles gadijuma if (isset($_POST['password']) || $password == "") { print "<p align=\"center\"><font color=\"red\"><b>Nepareiza parole</b><br>Megini velreiz...</font></p>";} print "<form method=\"post\"><p align=\"center\">Ievadi paroli lai pieklutu adresei!<br>"; print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\"><input value=\"Ienakt\" type=\"submit\"></p></form>"; } ?> Edited March 18, 2011 by Snaip3Rs Quote Link to comment Share on other sites More sharing options...
briedis Posted March 18, 2011 Report Share Posted March 18, 2011 (edited) Kods ir neglīts, bet nekā nedroša te nav. Edited March 18, 2011 by briedis Quote Link to comment Share on other sites More sharing options...
Zefirs Posted March 18, 2011 Report Share Posted March 18, 2011 (edited) if(ip nav banlistā){ If(parole pareiza){pielaižam pie vietnes , user_status_db=0} elseif(ja parole ir tukša){ lai mēģina ievadīt vēlreiz } else{ user_status_db+=1; if (user_status_db>3){pievienojam db, ka ir pie banotā lista}else{redirektējam uz login} }else{metam ārā} Uz ātro izdomāju kā varētu būt. Mby kur kļūda -ideju galenais saprast. Edited March 18, 2011 by Zefirs Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted March 19, 2011 Author Report Share Posted March 19, 2011 Es daudz no php nesaprotu tāpēc palūgšu vai kāds var tam kodam pielikt lai parole sessionos saglabājās lai pēc katra refresh nav parole jāraksta pa jaunu! Un pec tam es pats macesu uztaisīt pogu destroy sesion! Quote Link to comment Share on other sites More sharing options...
wintermute Posted March 19, 2011 Report Share Posted March 19, 2011 A davai ka tu pamēģini mācīties: Beginning PHP and MySQL Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.