Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require_once("connect.php");
- if(isset($_POST['username']) && isset($_POST['password'])) {
- if( !(empty($_POST['username'] ) ) && (!empty($_POST['password'])) ) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $stmt = $mysqli->prepare("SELECT username, password FROM user WHERE username = ? && password = ?");
- $stmt->bind_param('ss', $username, $password);
- $stmt->execute();
- $result = $stmt->get_result();
- if($result_array = $result->fetch_assoc()) {
- echo "jest ok";
- echo $result_array["username"];
- //ustaw sesje
- } else {
- echo "dupa";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement