Ir para conteúdo
Fórum Script Brasil

Thiagoo

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Tudo que Thiagoo postou

  1. Thiagoo

    Como excluir com checkbox

    Não entendi. O codigo que uso para excluir é esse: <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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($_POST['excluir'])) && ($_POST['excluir'] != "")) { $deleteSQL = sprintf("DELETE FROM member WHERE id=%s", GetSQLValueString($_POST['excluir'], "int")); mysql_select_db($database_net, $net); $Result1 = mysql_query($deleteSQL, $net) or die(mysql_error()); $deleteGoTo = "../Amigos.php"; if (isset($_SERVER['QUERY_STRING'])) { $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?"; $deleteGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $deleteGoTo)); } ?> O codigo que uso para selecionar as id é esse: <form action=../Deletar/Deletar amigo.php" method="post" name="form1"> <label> <input type="submit" class="botton_delete" value="Deletar" /> <input name="excluir" type="checkbox" id="excluir" value="<?php echo $row_membros['id]; ?>" /> </label> </form> O que ta errado?
  2. Olá como eu faço para excluir com uma checkbox os arquivos pela "id" da minha db? Eu criei uma tabela com o nome da pessoa e coloquei uma checkbox com os valores: <input name="excluir" type="checkbox" id="excluir" value="<?php echo $row_membros['id']; ?>" />
×
×
  • Criar Novo...