-
Posts
122 -
Cadastrado em
-
Última visita
Tópicos solucionados
-
O post de Joel Martins em Confirmar o inicio de sessão foi marcado como solução
Obrigado por toda a ajuda proporcionada mas dou por encerrado este tópico : )
-
O post de Joel Martins em Erro se password ou username estiver errado foi marcado como solução
Obrigado por toda a ajuda proporcionada mas dou por encerrado este tópico : )
-
O post de Joel Martins em Clicar em img e mostrar ou esconder pass foi marcado como solução
@Rui Guilherme essa parte eu já tinha reparado. Mas o que não funciona é a parte do código JS.
Obrigado mais uma vez :))
Boas,
Acabei por encontrar um muito parecido ao seu:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <style type="text/css"> input, input[type=password] { width: 150px; height: 20px; } #toggle_pwd { cursor: pointer; } </style> </head> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> <input type="password" id="txtPassword" /> <span id="toggle_pwd" class="fa fa-fw fa-eye field_icon"></span> <script type="text/javascript"> $(function () { $("#toggle_pwd").click(function () { $(this).toggleClass("fa-eye fa-eye-slash"); var type = $(this).hasClass("fa-eye-slash") ? "text" : "password"; $("#txtPassword").attr("type", type); }); }); </script> </body> </html> Muito obrigado na mesma por toda a sua ajuda : )
-
O post de Joel Martins em Clicar em img e mostrar ou esconder pass foi marcado como solução
@Rui Guilherme essa parte eu já tinha reparado. Mas o que não funciona é a parte do código JS.
Obrigado mais uma vez :))
Boas,
Acabei por encontrar um muito parecido ao seu:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <style type="text/css"> input, input[type=password] { width: 150px; height: 20px; } #toggle_pwd { cursor: pointer; } </style> </head> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> <input type="password" id="txtPassword" /> <span id="toggle_pwd" class="fa fa-fw fa-eye field_icon"></span> <script type="text/javascript"> $(function () { $("#toggle_pwd").click(function () { $(this).toggleClass("fa-eye fa-eye-slash"); var type = $(this).hasClass("fa-eye-slash") ? "text" : "password"; $("#txtPassword").attr("type", type); }); }); </script> </body> </html> Muito obrigado na mesma por toda a sua ajuda : )
-
O post de Joel Martins em Criar um LOGIN form foi marcado como solução
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 :))
-
O post de Joel Martins em Criar um LOGIN form foi marcado como solução
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 :))
-
O post de Joel Martins em Criar um LOGIN form foi marcado como solução
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 :))
-
O post de Joel Martins em Enviar dados de um form para uma DB foi marcado como solução
Muito obrigado por toda a ajuda@CyberPh4ntom
Já consegui realizar esta parte.
Form parte:
<form class="form" method="POST" action="http://localhost/clientes/metronic_v8.0.13/html_bootstrap5/theme/demo1/dist/apps/customers/insert.php" id="kt_modal_add_customer_form"> <div class="ai"> <!--begin::Modal header--> <div class="modal-header" id="kt_modal_add_customer_header"> <!--begin::Modal title--> <h2 class="fw-bolder">Adicionar Cliente</h2> <!--end::Modal title--> <!--begin::Close--> <div id="kt_modal_add_customer_close" class="btn btn-icon btn-sm btn-active-icon-primary"> <!--begin::Svg Icon | path: icons/duotone/Navigation/Close.svg--> <span class="svg-icon svg-icon-1"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1"> <g transform="translate(12.000000, 12.000000) rotate(-45.000000) translate(-12.000000, -12.000000) translate(4.000000, 4.000000)" fill="#000000"> <rect fill="#000000" x="0" y="7" width="16" height="2" rx="1" /> <rect fill="#000000" opacity="0.5" transform="translate(8.000000, 8.000000) rotate(-270.000000) translate(-8.000000, -8.000000)" x="0" y="7" width="16" height="2" rx="1" /> </g> </svg> </span> <!--end::Svg Icon--> </div> <!--end::Close--> </div> <!--end::Modal header--> <!--begin::Input group--> <div class="fv-row mb-7"> <!--begin::Label--> <label class="fs-6 fw-bold mb-2"> <span class="required">Nome</span> <i class="faz fa-exclamation-circle ms-1 fs-7 sb" data-bs-toggle="tooltip" title="Tem que inserir o nome completo."></i> </label> <!--end::Label--> <!--begin::Input--> <input type="text" name="nome" class="form-control form-control-solid sb" placeholder="" placeholder="Insira o nome" /> <!--end::Input--> </div> <!--end::Input group--> <br> <!--begin::Input group--> <div class="fv-row mb-7"> <!--begin::Label--> <label class="fs-6 fw-bold mb-2"> <span class="required">Website</span> <i class="faz fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="O website terá que ser válido."></i> </label> <!--end::Label--> <!--begin::Input--> <input type="text" name="website" class="form-control form-control-solid sb" placeholder="www.website.com" value="" /> <!--end::Input--> </div> <!--end::Input group--> <br> <!--begin::Input group--> <div class="fv-row mb-7"> <!--begin::Label--> <label class="fs-6 fw-bold mb-2"> <span class="required">Email</span> <i class="faz fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="O email tem que estar activo."></i> </label> <!--end::Label--> <!--begin::Input--> <input type="email" name="email" class="form-control form-control-solid sb" placeholder="[email protected]" value="" /> <!--end::Input--> </div> <!--end::Input group--> <!--begin::Input group--> <br> <div class="d-flex flex-column mb-7 fv-row"> <!--begin::Label--> <label class="fs-6 fw-bold mb-2"> <span class="required">Serviço</span> <i class="faz fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Serviço desejado."></i> </label> <!--end::Label--> <!--begin::Input--> <select class="form-select form-select-solid dropdown ss" name="servico" aria-label="Selecione um Serviço" data-control="select2" data-placeholder="Selecione um serviço..." data-dropdown-parent="#kt_modal_add_customer"> <option class="dopdown-content ss" name="servico" value="">Selecione um serviço...</option> <option class="dopdown-content ss" name="servico" value="Alojamento Web">Alojamento Web</option> <option class="dopdown-content ss" name="servico" value="Aplicação Mobile">Aplicação Mobile</option> <option class="dopdown-content ss" name="servico" value="Criação de Lojas Online">Criação de Lojas Online</option> <option class="dopdown-content ss" name="servico" value="Criação de Websites">Criação de Websites</option> <option class="dopdown-content ss" name="servico" value="Marketing Digital">Marketing Digital</option> <option class="dopdown-content ss" name="servico" value="Suporte Profissional">Suporte Profissional</option> </select> <!--end::Input--> </div> <!--end::Input group--> <!--begin::Input group--> <div class="fv-row mb-7"> <!--begin::Label--> <label class="fs-6 fw-bold mb-2"> <span class="required dn">Data</span> <i class="faz fa-exclamation-circle ms-1 fs-7 dni" data-bs-toggle="tooltip" title="Data tem que ser atualizada."></i> </label> <!--end::Label--> <!--begin::Input--> <input type="date" name="data" class="form-control form-control-solid sd" placeholder="00/00/0000" value="" /> <!--end::Input--> </div> <!--end::Input group--> <!--begin::Input group--> <div class="fv-row mb-7"> <!--begin::Label--> <label class="fs-6 fw-bold mb-2"> <span class="required" style="font-size:150%">Montante</span> <i class="faz fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Quantidade (entre 0 and 999999)"></i> </label> <!--end::Label--> <!--begin::Input--> <input type="number" id="quantity" class="montante" name="montante" min="0" max="999999" value="$$$$$"></div> <!--end::Input--> </div> <!--end::Input group--> <!--begin::Modal footer--> <div class="modal-footer flex-center"> <!--begin::Button--> <button type="reset" id="kt_modal_add_customer_cancel" class="btn btn-white me-3">Discard</button> <!--end::Button--> <!--begin::Button--> <button type="submit" name="enviar" value="Enviar"> <span class="bt">Submit</span> <span class="indicator-progress">Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span></span> </button> <!--end::Button--> </div> <!--end::Modal footer--> </div> </form> <!--end::Form--> PHP parte:
<?php $servername = "****"; $database = "****"; $username = "****"; $password = "****"; $conn = new mysqli ($servername, $username, $password,$database); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } else { echo "Connected successfully"; $nome = $_POST['nome']; $website = $_POST['website']; $email = $_POST['email']; $serv= $_POST['servico']; $data = $_POST['data']; $montante = $_POST['montante']; $sql = "INSERT INTO tb (`nome`,`website`,`email`,`serv`,`data`,`montante`) VALUES ('$nome', '$website','$email','$serv','$data','$montante')"; } if (mysqli_query($conn, $sql)) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } mysqli_close($conn); echo "Cliente registado com sucesso!"; ?> Agora estou a tentar realizar a exibição dos dados.
Tabela:
<!--begin::Table--> <table class="table align-middle table-row-dashed fs-6 gy-5" id="kt_customers_table"> <!--begin::Table head--> <thead> <!--begin::Table row--> <tr class="text-start text-gray-400 fw-bolder fs-7 text-uppercase gs-0"> <th class="w-10px pe-2"> <div class="form-check form-check-sm form-check-custom form-check-solid me-3"> <input class="form-check-input" type="checkbox" data-kt-check="true" data-kt-check-target="#kt_customers_table .form-check-input" value="1" /> </div> </th> <th class="min-w-125px">id</th> <th class="min-w-125px">Nome</th> <th class="min-w-125px">Website</th> <th class="min-w-125px">Email</th> <th class="min-w-125px">Serviço</th> <th class="min-w-125px">Data</th> <th class="min-w-125px">Montante</th> <th class="text-end min-w-70px">Delete</th> </tr> <!--end::Table row--> </thead> <!--end::Table head--> <!--begin::Table body--> <tbody class="fw-bold text-gray-600"> <tr> <!--begin::Checkbox--> <td> <div class="form-check form-check-sm form-check-custom form-check-solid"> <input class="form-check-input" type="checkbox" value="1" /> </div> </td> <!--end::Checkbox--> <?php while($dado = $con->fetch_array()) { ?> <!--begin::id--><td><?php echo $dado = ['id']?></td><!--end::id--> <!--begin::nome--><td><?php echo $dado = ['nome']?></td><!--end::nome--> <!--begin::website--><td><?php echo $dado = ['website']?></td><!--end::website--> <!--begin::e-mail--><td><?php echo $dado = ['email']?></td><!--end::email--> <!--begin::Serviço--><td><?php echo $dado = ['servico']?></td><!--end::Serviço--> <!--begin::Data--><td><?php echo $dado = ['data']?></td><!--end::Data--> <!--begin::Montante--><td><?php echo $dado = ['montante']?></td><!--end::Montante--> <?php } ?> <!--begin::Action=--> <td class="text-end"> <!--begin::Menu item--> <div class="menu-item px-3"> <button id="delete" alt="delete" .class="menu-link px-3" data-kt-customer-table-filter="delete_row"><b>Delete</b></button> </div> </td> <!--end::Action=--> </tr> </td> <!--end::Action=--> </tr> </tbody> <!--end::Table body--> </table> <!--end::Table--> Mas a parte em PHP não estou a conseguir realizar.
Sobre o Clube do Hardware
No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais
Direitos autorais
Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais