Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("connect.php");
- $post_username= $_POST['username'];
- $post_password= $_POST['password'];
- if($post_username && $post_password ){
- if(strlen($post_username)>20 || strlen ($post_password)>20){
- echo "<font color=\"white\" face='arial'>"."Napaèno uporabniško ime ali geslo"."</font>"."<br>"."<img src='error.png'>";
- }else{
- $post_password=md5($post_password);
- $login =sprintf("SELECT * from USERS WHERE username='%s' and password='%s' ", mysql_real_escape_string($post_username),mysql_real_escape_string($post_password));
- $rowcount=mysql_num_rows(mysql_query($login));
- if($rowcount ==1){
- $_SESSION['user']=$post_username;
- if (!isset($_GET['reload'])) {
- echo '<meta http-equiv=Refresh content="0;url=index2.php?reload=1">';
- }
- }else{
- echo "<font color=\"white\" face='arial'>"."Napaèno uporabniško ime ali geslo"."</font>"."<br>"."<img src='error.png'>";
- }
- }
- }else{
- echo "<font color=\"white\"face='arial'>"."Obe polji morata biti vnešeni!"."</font>"."<br>"."<img src='error.png'>";
- }
- ?>
- <br>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement