Ir para conteúdo
Fórum Script Brasil
  • 0

Delete


salvacao

Pergunta

Estou utilizando o procedimento dentro do Dreamweaver (Application->Server Behaviors ->Delete Record) .

O meu problema é o seguinte estou tentando excluir um registro quando eu aperto o botão “Excluir” ele não está excluindo, ele simplesmente volta na tela anterior,parece que ele não está entrando na função de exclusão. Eu tenho que informar alguma coisa no form para ele executar a função de exclusão que está vindo no início do arquivo no momento que eu apertar o botão?

Segue o código para melhor exemplificar a minha dúvida:

<?php require_once('Connections/gvshopping.php'); ?>

<?php

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {

case "text":

$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

break;

case "long":

case "int":

$theValue = ($theValue != "") ? intval($theValue) : "NULL";

break;

case "double":

$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";

break;

case "date":

$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

break;

case "defined":

$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

break;

}

return $theValue;

}

if ((isset($_GET['codProduto'])) && ($_GET['codProduto'] != "")) {

$deleteSQL = sprintf("DELETE FROM produto WHERE codProduto=%s",

GetSQLValueString($_GET['codProduto'], "int"));

mysql_select_db($database_gvshopping, $gvshopping);

$Result1 = mysql_query($deleteSQL, $gvshopping) or die(mysql_error());

$deleteGoTo = "/index.php";

if (isset($_SERVER['QUERY_STRING'])) {

$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";

$deleteGoTo .= $_SERVER['QUERY_STRING'];

}

header(sprintf("Location: %s", $deleteGoTo));

}

?>

<form action="" method="post" name="frmExProduto" id="frmExProduto">

.

.

<input name="Excluir" type="submit" class="Botao" id="Excluir" value="Excluir Produto">

</form>

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652,1k
×
×
  • Criar Novo...