Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table border=1 align="right" width=100% bgcolor="white" >
- <tr>
- <td align="left"><font color="red" size=12><b>Glasbena trgovina</b></font></td> <!-- naslov strani -->
- <td align="right">
- <?php
- include('mysql.php');
- if(isset($_POST['submit'])){
- $username = mysql_escape_string($_POST['username']);
- $password = mysql_escape_string(md5($_POST['password']));
- if(!empty($username) && !empty($password)) {
- $sql = mysql_query("SELECT * FROM users
- WHERE username='".$username."' AND
- user_password='".$password."' LIMIT 1");
- if(mysql_num_rows($sql)==1){
- $_SESSION['loggedin'] = true;
- $_SESSION['username'] = $username;
- echo 'Uporabnik:<font color="red"> '.$_POST['username'].' </font><a href="logout.php"> logout</a>';
- }else{
- echo 'Tvoje uporabniško ime ali geslo je napacno!';
- }
- }else{
- echo 'Vnesi uporabniško ime in geslo!';
- }
- }else{
- echo '<form action="index.php" method="post">
- Uporabniško ime: <input type="text" name="username"/>
- Geslo: <input type="password" name="password"/>
- <input type="submit" name="submit" value="Vpiši se"/>
- </form>';
- }
- //registracija link
- if($_SESSION['loggedin'] == false ){
- echo '<a href="register.php">Registrirajte se!</a>';
- }
- ?>
- </td>
- </tr>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement