Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include("konekcija_na_bazu.php");
- if(!empty($_POST['username']) and !empty($_POST['password'])){
- $username = mysql_real_escape_string($_POST['username']);
- $password = md5(mysql_real_escape_string($_POST['password']));
- $checklogin = mysql_query("SELECT * FROM members WHERE username = '".$username."' AND password = '".$password."'");
- if(mysql_num_rows($checklogin) == 1){
- $_SESSION['login'] = $username;
- header("location:home.php");
- }
- else{
- echo "<h1>Greska</h1>";
- echo "<p>Klikni na <a href=\login1.php\>i probajte ponovo</a></p>";
- }
- }
- else{
- ?>
- <html>
- <body>
- <h1>Login</h1>
- <p>Hvala na posjeti! Logirajte se</p>
- <form action="login1.php" method="POST">
- <b>username:</b><input type="text" name="username" id="username"></br>
- <b>password:</b><input type="password" name="password" id="password"></br>
- <input type="submit" value="login"><input type="reset" value="Obrisi">
- </form>
- </body>
- </html>
- <?php
- }
- ?>
- <html>
- <body>
- </hr>
- <a href="registration_form.php">registracija</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement