index.php
<?php include('includes/config.php'); { include("forms/login.php"); } else { # #Logowanie # $sql = "SELECT * FROM `v_users` WHERE `user_password`='".$password."' AND `user_username`='".$username."'"; { $getid = "SELECT * FROM `v_users` WHERE `user_username`='".$username."' LIMIT 1"; $userid = $r[userid]; } $_SESSION['logged']=1; } else { } # #--------------------------------------------------------- # } { #... #TRESCI DOSTEPNA PO ZALOGOWANIU #... include("forms/logout.php"); } ?>
includes/config.php
<?php #Polaczenie z baza danych $db_host = "localhost"; $db_user = "root"; $db_pass = ""; $db_name = "database"; #Login/Logout $username=$_POST['login']; $password=$_POST['pass']; $logout=$_POST['logout']; ?>
Czy ten skrypt jest wystarczajaco bezpieczy czy moze powinenem w nim cos zmienic - dodac?