Ir para conteúdo
Fórum Script Brasil

Estevan Silveira

Membros
  • Total de itens

    4
  • Registro em

  • Última visita

Sobre Estevan Silveira

Estevan Silveira's Achievements

0

Reputação

  1. Preciso que esses dois objeto(input, e button) fiquem centralizados juntos, e também preciso diminuir o botão e aumentar na horizontal a caixa de pesquisa. Já tentei de todos os tipos mas nenhum deu certo. <?php session_start(); include_once('../php/php_config/config.php'); if((!isset($_SESSION['email']) == true) and (!isset($_SESSION['senha']) == true)){ unset($_SESSION['email']); unset($_SESSION['senha']); header('Location:tela_login.php'); } $autenticado = $_SESSION['email']; if(!empty($_GET['search'])){ $data = $_GET['search']; $sql = "SELECT * FROM produto WHERE nome LIKE '%$data' or estado LIKE '%$data' or cidade LIKE '%$data' or tipo LIKE '%$data' ORDER BY nome ASC"; } else{ $sql = "SELECT * FROM produto ORDER BY nome ASC"; } $result = $conexao->query($sql); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="../style/tela_menuPrincipal.css" /> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="icon" type="image/png" href="../imgs/LOGO_SEM_NOME-removebg-preview-_1_.ico"/> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;900&display=swap" rel="stylesheet" /> <title>Dótis - Menu - Instituição</title> </head> <body> <style> td, th{ padding: .7em; margin: 0; border: 1px solid #ccc; text-align:center; } table{ width: 100%; margin-bottom: .5em; text-align: center; color: rgb(146, 19, 146); padding: 20px; padding-left: 50px; padding-right: 50px; } h2{ text-align: center; color: rgb(146, 19, 146); } .box-search{ justify-content: center; display:inline-block; gap: 1%; text-align: center; } .box-search.pesquisar{ text-align: center; } </style> <header> <h1>Dótis - Plataforma de auxílio em doações</h1> </header> <nav> <ul> <li><a href = "logout.php">Sair</a></li> </nav> <br> <h2 >Produtos</h2> <br> <div class="box-search"> <input type="search" class="form-control" placeholder="Pesquisar" id="pesquisar"> <button onclick = "searchData()"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"> <path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/> </svg> </button> </div> <div> <table class = table> <thead> <tr> <th scope="col">Nome</th> <th scope="col">Descrição</th> <th scope="col">Estado</th> <th scope="col">Cidade</th> <th scope="col">Tipo</th> <th scope="col">---</th> </tr> </thead> <tbody> <?php while($user_data = mysqli_fetch_assoc($result)) { echo "<tr color='black'>"; echo "<td>".$user_data['nome']."</td>"; echo "<td>".$user_data['descricao']."</td>"; echo "<td>".$user_data['estado']."</td>"; echo "<td>".$user_data['cidade']."</td>"; echo "<td>".$user_data['tipo']."</td>"; echo "</tr>"; } ?> </tbody> </table> </div> </div> <script src="" crossorigin="anonyumous"></script> <footer> <li><a href="../php/tela_sac.php"><u>Contate-nos!</u></a></li> </footer> </body> <script> var search = document.getElementById('pesquisar'); search.addEventListener("keydown", function(event){ if(event.key === "Enter"){ searchData(); } }); function searchData(){ window.location = 'tela_menuInst.php?search='+search.value; } </script> </html> * { box-sizing: border-box; margin: 0; padding: 0; font-family: "Poppins", sans-serif; } nav { background-color: rgb(146, 19, 146); padding: 10px; height: 30px; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; height: 55px; } header { background-color: rgb(146, 19, 146); padding: 10px; text-align: center; color: white; } ul { text-align: center; list-style: none; padding: 10px; margin: 0px; } li { display: inline; padding: 8px 16px; } li a { text-decoration: none; color: white; padding: 8px 16px; } li a:hover { background-color: rgb(117, 3, 117); color: white; } footer { font-size: 12px; background-color: rgb(146, 19, 146); padding: 10px; text-align: center; color: white; border-top-left-radius: 5px; border-top-right-radius: 5px; width: 100%; position: relative; bottom: 0; left: 0; } body { display: flex; justify-content: center; align-items: center; text-align: center; color: rgb(146, 19, 146); background-color: rgb(252, 249, 249); }
  2. Estou trabalhando em um projeto de php, mas quando tento fazer redirecionamento de uma classe para outra apresenta o seguinte erro: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at postmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Vi alguns vídeos na internet, que diziam para desinstalar o arquivo ".htaccess", mas já o desinstalei e o erro persistiu. Uso o Opera como browser, mas o problema não é esse já tentei mudar de navegador mas não adiantou. <?php if(isset($_POST['submit']) && !empty($_POST['email']) && !empty($_POST['password'])){ include_once('../php/php_config/config.php'); $email = $_POST['email']; $senha = $_POST['password']; $sql1 = "SELECT * FROM doador WHERE email = '$email' AND senha = '$senha'"; $sql2 = "SELECT * FROM instituicao WHERE email = '$email' AND senha = '$senha'"; $result1 = $conexao->query($sql1); $result2 = $conexao->query($sql2); if(mysqli_num_rows($result1) < 1){ if(mysqli_num_rows($result2) < 1){ header('Location : tela_login.php'); } else{ header('Location : ../php/tela_menuInst.html'); } } else{ header('Location : ../php/tela_menuDoador.html'); } } else{ header('Location : tela_login.php'); } ?>
  3. Realmente o problema estava na sintaxe da mysqli_query. Valeu.
  4. Não consigo inserir os dados que são digitados pelo usuário no formulário no banco de dado, pois apresenta este erro ao tentar rodar no navegador: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near". Já tentei de vários jeitos, utilizando aspas simples, crase e até sem nada nos parametros, mas sempre aparece a mesma mensagem. <?php if(isset($_POST['submit'])){ include_once('../php/php_config/config.php'); $nome = $_POST['username']; $cpf = $_POST['cpf']; $email = $_POST['email']; $senha = $_POST['password']; $result = mysqli_query($conexao, "INSERT TO doador(nome, cpf, email, senha) VALUES($nome, $cpf, $email, $senha)"); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="../style/tela_cadastro.css" /> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="icon" type="image/png" href="../imgs/LOGO_SEM_NOME-removebg-preview-_1_.ico"/> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;900&display=swap" rel="stylesheet" /> <title>Dótis - Cadastro de Doador</title> <style> form #submit{ border: 0; padding: 10px 50px; border-radius: 5px; cursor: pointer; letter-spacing: 1px; font-size: 1rem; font-weight: bold; position: relative; text-transform: uppercase; transition: all 0.5s; width: 300px; margin-left: 30px; margin-right: 30px; background-color: #eee; } form #submit:hover{ box-shadow: 1px 1px 0, 2px 2px 0, 3px 3px 0, 4px 4px 0, 5px 5px 0, 6px 6px 0; background-color: white; color: rgb(146, 19, 146); } </style> </head> <body> <header> <h1>Dótis - Plataforma de auxílio em doações</h1> </header> <nav> <ul> <li><a href="./tela_inicial1.html">Menu Inicial</a></li> </nav> <section> <div class="container"> <div class="header"> <h2>Criar uma Conta</h2> </div> <form action="tela_cadastroDoador.php" method="POST" id="form" class="form"> <div class="form-control"> <label for="username">Nome de Usuário</label> <input name="username" type="text" id="username" placeholder="Digite seu nome de usuário..." required /> <i class="fas fa-exclamation-circle"></i> <i class="fas fa-check-circle"></i> <small>Mensagem de erro</small> </div> <div class="form-control"> <label for="cpf">Cpf</label> <input name="cpf" type="text" id="cpf" placeholder="Digite seu cpf..." required /> <i class="fas fa-exclamation-circle"></i> <i class="fas fa-check-circle"></i> <small>Mensagem de erro</small> </div> <div class="form-control"> <label for="email">Email</label> <input name="email" type="text" id="email" placeholder="Digite seu email..." required /> <i class="fas fa-exclamation-circle"></i> <i class="fas fa-check-circle"></i> <small>Mensagem de erro</small> </div> <div class="form-control"> <label for="password">Senha</label> <input name="password" type="password" id="password" placeholder="Digite sua senha..." required /> <i class="fas fa-exclamation-circle"></i> <i class="fas fa-check-circle"></i> <small>Mensagem de erro</small> </div> <div class="form-control"> <label for="password-confirmation">Confirmação</label> <input name="password-confirmation" type="password" id="password-confirmation" placeholder="Digite sua senha..." required /> <i class="fas fa-exclamation-circle"></i> <i class="fas fa-check-circle"></i> <small>Mensagem de erro</small> </div> <input type="submit" id="submit" name="submit"> </form> </div> </section> <script src="" crossorigin="anonyumous"></script> <footer> <li><a href="../php/tela_sac.html"><u>Contate-nos!</u></a></li> </footer> </body> </html>
×
×
  • Criar Novo...