Skip to content

Conversation

@aj33
Copy link

@aj33 aj33 commented Jul 7, 2016

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
Copy link

Dvl1 commented Oct 5, 2016

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