Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- session_regenerate_id(true);
- $username = $_POST['username'];
- $password = $_POST['password'];
- $login = $_SERVER['HTTP_REFERER'];
- $_SESSION["username"] = "$username";
- if( ( !$username) or (! $password ))
- {header ("Location:$login"); exit(); }
- $conn=@mysql_connect( "localhost", "root", "")
- or die ("cannot connect");
- $rs = @mysql_select_db("dbusers", $conn)
- or die("database problem");
- $sql = "select * from dropbox where uname=\"$username\" and pass = \"$password\"";
- $rs = mysql_query($sql, $conn)
- or die ("could not execute query");
- $rows = mysql_numrows( $rs);
- if($rows !=0)
- {
- echo("<h2>$username okay - !welcome!</h2>");
- }
- else
- {
- header("Location:$login"); exit();
- }
- ?>
- <html>
- <body>
- Session usr =
- <?php
- echo(session_id());
- ?>
- <br><br>
- <a href="home.php?<?php echo(SID); ?>">Go to next page</a>
- <a href="home.php">Home</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement