Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once "conecta.php";
- $resultado = mysqli_query($conexao, "select * from curtida");
- $curtida = mysqli_fetch_assoc($resultado);
- ?>
- <!DOCTYPE html>
- <html lang="pt-br">
- <head>
- <meta charset="UTF-8" />
- <title>Curtir</title>
- <link rel="stylesheet" href="css/claudina.css" />
- </head>
- <body>
- <section class="recipiente margem-topo-50">
- <form action="envia_curtir.php" method="post">
- <input type="number" name="curtida" />
- <button class="icones icone-polegares-para-cima"></button>
- <?=$curtida['curtidas'];?>
- </form>
- </section>
- </body>
- </html>
- <?php
- require_once "conecta.php";
- require_once "funcoes.php";
- $curtida = $_POST['curtida'];
- curtir($conexao, $curtida);
- header("Location: index.php");
- ?>
- funcoes.php
- <?php
- function curtir($conexao, $curtida) {
- $query = "update curtida set curtidas= $curtida";
- return mysqli_query($conexao, $query);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement