Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'sadrzaj.php';
- session_start();
- // Check if he wants to login:
- if (!empty($_POST[username]))
- {
- require_once("connect.php");
- // Check if he has the right info.
- $query = mysql_query("SELECT * FROM members
- WHERE username = '$_POST[username]'
- AND password = '$_POST[password]'")
- or die ("Error - Ne mogu ce je ulogovati se na ovaj profil!.");
- $row = mysql_fetch_array($query)
- or die ("Error - Couldn't login user.");
- if (!empty($row[username])) // he got it.
- {
- $_SESSION[username] = $row[username];
- echo "<div class='timeline'><img src='$_POST[slika]'><br>Cao $_POST[username]! Uspesno si ulogovan.<a href='logout.php'><p align'right'>Odjavi se</p></a><br></div> ";
- echo"<div class='album
- '><a href='picture.php'><i>Album</i></a></div>";
- exit();
- }
- else // bad info.
- {
- echo "Error - Couldn't login user.<br /><br />
- Please try again.";
- exit();
- }
- }
- ?>
- <html>
- <head>
- <link rel="stylesheet" href="stil.css" type="text/css" />
- <a><img src="head.png"></a>
- <title>Uloguj se</title>
- </head>
- <body>
- <div class='login2'><form action="login.php" method="post">
- <table width="75%" " align="center" cellpadding="3" cellspacing="1">
- <tr>
- <td width="100%"><h5>Uloguj se</h5></td>
- </tr>
- <tr>
- <td width="100%"><label>Korisnicko ime: <input type="text" name="username" size="25" value="<? echo $_POST[username]; ?>"></label></td>
- </tr>
- <tr>
- <td width="100%"><label>Sifra: <input type="password" name="password" size="25" value=""></label></td>
- </tr>
- <tr>
- <td width="100%"><input type="submit" value="Uloguj se!"></td>
- </tr>
- <tr>
- <td width="100%"><a href="register.php">Registruj se!</td>
- </tr>
- </table>
- </form>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment