Skip to content

Update Login2.php#4

Open
aj33 wants to merge 1 commit into
tonikami:masterfrom
aj33:patch-2
Open

Update Login2.php#4
aj33 wants to merge 1 commit into
tonikami:masterfrom
aj33:patch-2

Conversation

@aj33

@aj33 aj33 commented Jul 7, 2016

Copy link
Copy Markdown

No description provided.

<?php
    require("password.php");

    $con = mysqli_connect("mysql.hostinger.in", "u271887473_ani", "ilove333anisha333", "u271887473_aj");
    
    $username = $_POST["username"];
    $password = $_POST["password"];
    
    $statement = mysqli_prepare($con, "SELECT * FROM user WHERE username = ?");
    mysqli_stmt_bind_param($statement, "s", $username);
    mysqli_stmt_execute($statement);
    mysqli_stmt_store_result($statement);
    mysqli_stmt_bind_result($statement, $colUserID, $colName, $colUsername, $colAge, $colPassword);
    
    $response = array();
    $response["success"] = false;  
    
    while(mysqli_stmt_fetch($statement)){
        if (password_verify($password, $colPassword)) {
            $response["success"] = true;  
            $response["name"] = $colName;
            $response["age"] = $colAge;
        }
    }

    echo json_encode($response);
?>
@Dvl1

Dvl1 commented Oct 5, 2016

Copy link
Copy Markdown

require("password.php"); where do i find this? Greetz Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants