Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

ricardo_pancini

unlink com o dreamweaver

Recommended Posts

Pessoal,Alguem conheçe alguma extensão que faça o trabalho da função unlink do php no dreamweaver ?Existe alguma maneira de se escrever essa função no código gerado pelo DW do server behavior ?Obrigado a todos !

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá amigo,Obrigado pela resposta.Tenho o seguinte código abaixo gerado pelo DW. Onde eu coloco o unlink ? Faz idéia ?Eu faço o delete usando a chave primária que é o cod. Preciso definir um comportamento só pra deletar a imagem ?Eu tentei fazer uma pagina só pra deletar a imagem, enviando o link da imagem, só que retorna o erro dizendo q. não tenho permissão a pasta (estou testando localmente).É preciso adicionar algo mais ou simplesmente usar a sintaxe do unlink como citado no manual do php ?Bom, de qualquer forma muito obrigado pela atenção ! Ai vai o código.<?phpfunction 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['cod'])) && ($_GET['cod'] != "")) { $deleteSQL = sprintf("DELETE FROM quibao_produtos WHERE cod=%s", GetSQLValueString($_GET['cod'], "int")); mysql_select_db($database_quibao, $quibao); $Result1 = mysql_query($deleteSQL, $quibao) or die(mysql_error()); $deleteGoTo = "ok.php"; if (isset($_SERVER['QUERY_STRING'])) { $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?"; $deleteGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $deleteGoTo));}?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.