Jump to content

Criar um LOGIN form


Joel Tavares Martins
 Share

Go to solution Solved by M6,

Recommended Posts

Bom dia,

Eu quero criar um programa para fazer login mas está a dar um erro estranho:

 

Esta página não está a funcionar

mixlifeserver.com não consegue processar este pedido de momento.

HTTP ERROR 500

 

Código HTML:

<html lang="pt">
	<head>
		<meta charset="utf-8" />
		<title>Login</title>
		<link rel="canonical" href="Https://preview.keenthemes.com/metronic8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link rel="shortcut icon" href="img/cliente1.png" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" />
		<link href="dist/assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
		<link href="dist/assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
	</head>
	<body id="kt_body" class="bg-white">
		<div class="d-flex flex-column flex-root">
			<div class="d-flex flex-column flex-lg-row flex-column-fluid">
				<div class="d-flex flex-column flex-lg-row-fluid py-10">
					<div class="d-flex flex-center flex-column flex-column-fluid">
						<div class="w-lg-500px p-10 p-lg-15 mx-auto">
							<form method="post" class="form w-100" novalidate="novalidate" id="kt_sign_in_form" action="dist/apps/customers/validation.php">
								<div class="text-center mb-10">
									<h1 class="text-dark mb-3">Login</h1>
								<div class="fv-row mb-10">
									<div class="d-flex flex-stack mb-2"></div>
										<label class="form-label fw-bolder text-dark fs-6 mb-0">Email</label>
									</div>
									<input class="form-control form-control-lg form-control-solid" type="email" name="username" autocomplete="off" value="" />
								</div>
								<div class="fv-row mb-10">
									<div class="d-flex flex-stack mb-2">
										<label class="form-label fw-bolder text-dark fs-6 mb-0">Password</label>
									</div>
									<input class="form-control form-control-lg form-control-solid" type="password" name="password" autocomplete="off" />
								</div>
								<div class="text-center">
									<button type="submit" value="Login" id="" class="btn btn-lg btn-primary w-100 mb-5">
										<span class="indicator-label">Continue</span>
										<span class="indicator-progress">Please wait...
										<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
									</button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script src="dist/assets/plugins/global/plugins.bundle.js"></script>
		<script src="dist/assets/js/scripts.bundle.js"></script>
		<script src="dist/assets/js/custom/authentication/sign-in/general.js"></script>
	</body>
</html>

Código PHP:

<?php

require'a/connect.php';

$trueuser="*****";
$truepass="*****";

$username = 'username';
$password = 'password';

if($username == $trueuser and $password == $truepass)
{
    header("location: welcome.php");
}
else
    {
        if($username == $trueuser and $password != $truepass)
        {
            echo'WRONG PASSWORD !!!
            Login Failed.';
        }
        else
            {
                if($username != $trueuser and $password == $truepass)
                {
                    echo'WRONG USERNAME !!!
                    Login Failed.';
                }
                else
                    {
                        if($username != $trueuser and $password != $truepass)
                        {
                            echo'WRONG PASSWORD AND USERNAME !!!
                            Login Failed.';
                        }
                    }
            }
    }

?>

Agradeço toda a ajuda possível :))

( ͡ಥ ͜ʖ ͡ಥ)- --- ---c(ˆ▿ˆc)

Link to comment
Share on other sites

  • Solution

Um 500 quer dizer que tens um erro que "rebentou" o servidor.
Consulta os logs de erro do web server para teres mais informação sobre a causa do erro.

  • Vote 1
10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.