Click here to Skip to main content
15,890,282 members

Comments by gavin_daCEO (Top 35 by date)

gavin_daCEO 23-Jan-21 7:13am View    
i will do that. God bless
gavin_daCEO 23-Jan-21 3:13am View    
i actually had a developer who was helping me with the project but then he dropped me since at that time i knew nothing about programming , i just had to learn. this one is just for demonstration purpose for the client. the real site i will find a developer who specializes with jsp . Thanks but i am also learning jsp. PHP is crap
gavin_daCEO 23-Jan-21 2:49am View    
i got it off the internet so i am still learning
gavin_daCEO 23-Jan-21 2:47am View    
no i did not do it
gavin_daCEO 21-Oct-20 5:23am View    
this is the complete code for the login page


if($_SERVER['REQUEST_METHOD'] == 'POST'){

$username = trim($_POST['username']);

try{

$Query = "SELECT * password FROM users WHERE username = :username";
$statement = $conn->prepare($Query);
$statement->bindValue(':username', $username);
$statement->execute();
$user = $statement->fetch(PDO::FETCH_ASSOC);
$RowCount = $statement->rowCount();

} catch (PDOerrorInfo $e){

die('QuerySCD Error '.$e->getMessage());

}

if( $RowCount == 0 ){

$_SESSION['message'] = "error!";

$message = "Invalid login credentials";

} else{ // User exists

if( password_verify($_POST['password'], $user['password'])){

$_SESSION['username'] = $user['username'];
$_SESSION['active'] = $user['active'];

$_SESSION['logged_in'] = true;

header("location: studentportal.php?onions=no&pickles=yes");

} else {

$_SESSION['message'] = "error!";
//header("location: error-login.php");
$message = "Invalid login credentials";

}
}
}

$conn = NULL;