async function login(){
    let r=await fetch("../api/login.php",{
        method:"POST",
        body:JSON.stringify({
            email:email.value,
            password:password.value
        })
    });

    let d=await r.json();
    if(d.success) location.href="dashboard.php";
    else alert("Login failed");
}