Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once ('crud.php');
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Formulario</title>
- <meta charset="utf-8">
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
- </head>
- <body>
- <div class="container">
- <!--nav bar-->
- <ul class="nav justify-content-center">
- <li class="nav-item">
- <a class="nav-link active" href="index.php">Cadastrar</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="del.php">Deletar</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="editar.php">Editar</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="listar.php">Listar</a>
- </li>
- </ul>
- <!-- Formulario -->
- <form method="POST">
- <label for="Telefone">Telefone</label><br><br>
- <input class="form-control form-control-lg" type="text" name="tel"><br><br>
- <div class="nav justify-content-center">
- <input type="submit" name="enviar" value="Deletar" lass="btn btn-primary">
- </div>
- </form>
- </div>
- <?php
- if(isset($_POST['enviar'])){
- $tel = $_POST['tel'];
- $del = new crud('localhost','atividade','root','');
- $dados = array('tel'=>$tel);
- $del->delete($dados,'cadastro');
- $aux = $del->delete($dados,'cadastro');
- ?> este é o var dump do delete <?php var_dump($aux);
- if($aux){
- ?>
- <script>
- window.alert("Usuario excluido com sucesso!");
- </script>
- <?php
- }else{
- ?>
- <script>
- window.alert("O usuario não pode ser excluido, talvez este não seja o numero de telefone correto!");
- </script>
- <?php
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement