Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Aqui você faz a requisição do arquivo conexão.php */
- require_once "conexao.class.php";
- require_once "crud.class.php";
- $con = new conexao();
- $operacao = new crud("contatos");
- /* Aqui é a passagem dos valores das variaveis */
- $acao = $_GET['acao'];
- $nome = $_POST['nome'];
- $fone = $_POST['fone'];
- if(isset($_GET["id"])){
- $id = $_GET["id"];
- }
- switch($acao){
- case "adicionar":{
- $operacao->inserir($nome,$fone);
- break;
- }
- case "remover":{
- $operacao->deletar($id);
- break;
- }
- case "atualizar":{
- $operacao->editar($nome,$fone,$id);
- break;
- }
- default;{
- header ("Location:index.php");
- }
- }
- header ("Location:index.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement