Parse error: syntax error, unexpected ‘if’ (T_IF) in C:\xampp\htdocs\web\co

<?php
$firstname = $_POST{'firstname'};
$username = $_POST{'username'};
$emailaddress = $_POST{'emailaddress'};
$password = $_POST{'password'};
$contact = $_POST{'contact'};

//Database connection
$conn =new mysqli('localhost','root','','registration');
if ($conn->connect_error) {
    die('connection failed : '.$conn->connect_error)
}else{
    $stmt = $conn->prepare("insert into users(firstname, username, emailaddress, password, contact)
        vlaues (?, ?, ?, ?, ?)")
    $stmt-> bind param("ssssi",$firstname, $username, $emailaddress, $password, $contact)
    $stmt->execute();
    echo "Submitted Succesfully...";
    $stmt->close();
    $stmt->close();
}

?>