hercioneto

PW1 2019 - salvaMarca.php

Nov 5th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="br">
  3.  
  4. <head>
  5.   <meta charset="utf-8">
  6.   <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.  
  8.   <meta name="description" content="">
  9.   <meta name="author" content="">
  10.   <title>Cadastrar Marca</title>
  11.  
  12. </head>
  13.  
  14. <body>
  15.  
  16.           <?php
  17.  
  18.           require "Marca.class.php";
  19.           if ($_POST) {
  20.               $nomeMarca = $_POST["marca"];
  21.              
  22.               $marca = new marca();
  23. $marca->setMarca($nomeMarca);
  24. $resultado = $marca->cadastrar();
  25.     if ($resultado ==0) {
  26.         echo "Marca cadastrada com sucesso com o código: ". $marca->getIdMarca();
  27.         echo "<br/>";
  28.     }
  29.     else {
  30.         echo "Erro";
  31.     }
  32.              
  33.           }
  34.           else {
  35.               echo "Dados não preenchidos";
  36.           }
  37.           ?>
  38.        
  39. </body>
  40.  
  41. </html>
Add Comment
Please, Sign In to add comment