Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
:unsure: Oi, olha eu de novo aqui hehehe.Pessoal, eu tenho uma seção de administração de bd de um website onde tenho várias páginas que modificam o bd com inclusão atualização e exclusão, em todas elas após executada a ação tem um header que direcionaria para uma página com mensagem de operação efetuada com sucesso. No entanto, estou tendo problemas pq todas elas retornam O errinho do headers already sent in XX. Tem algum macetezinho pronto ai pra achar o erro do headers? to ficando desesperado já. Vê ai embaixo alguns dos códigos:
<?php require_once('../../connnections/gepem.php'); ?><?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;}$editFormAction = $_SERVER['PHP_SELF'];if (isset($_SERVER['QUERY_STRING'])) {$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);}if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {$updateSQL = sprintf("UPDATE arquivos SET Titulo=%s, Ano=%s, Autor=%s, Autor_form=%s, Descricao=%s, Orientador=%s, Instituicao=%s, Doc_tipo=%s WHERE N_controle=%s", GetSQLValueString($_POST['Titulo'], "text"), GetSQLValueString($_POST['Ano'], "text"), GetSQLValueString($_POST['Autor'], "text"), GetSQLValueString($_POST['Autor_form'], "text"), GetSQLValueString($_POST['Descricao'], "text"), GetSQLValueString($_POST['Orientador'], "text"), GetSQLValueString($_POST['Instituicao'], "text"), GetSQLValueString($_POST['Doc_tipo'], "text"), GetSQLValueString($_POST['N_controle'], "int"));mysql_select_db($database_gepem, $gepem);$Result1 = mysql_query($updateSQL, $gepem) or die(mysql_error());}//$updateGoTo = "/php/adm/sucesso.php";// if (isset($_SERVER['QUERY_STRING'])) {// $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";// $updateGoTo .= $_SERVER['QUERY_STRING'];header("Location: www.uxx.br/xxxxx/sucesso.php");?>
:rolleyes:
<?phpinclude ("conecta_mysql.inc.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;}// Where the file is going to be placed $target_path = "docs/";/* Add the original filename to our target path. Result is "uploads/filename.extension" */$target_path = $target_path . basename( $_FILES['Documento_local']['name']); $_FILES['Documento_local']['tmp_name']; move_uploaded_file($_FILES['Documento_local']['tmp_name'], $target_path);if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= '?' . htmlentities($_SERVER['QUERY_STRING']);}if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO arquivos (Titulo, Ano, Autor, Autor_form, Descricao, Orientador, Instituicao, Documento_local, Doc_tipo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Titulo'], "text"), GetSQLValueString($_POST['Ano'], "text"), GetSQLValueString($_POST['Autor'], "text"), GetSQLValueString($_POST['Autor_form'], "text"), GetSQLValueString($_POST['Descricao'], "text"), GetSQLValueString($_POST['Orientador'], "text"), GetSQLValueString($_POST['Instituicao'], "text"), GetSQLValueString($_POST['Documento_local'], "text"), GetSQLValueString($_POST['Doc_tipo'], "text")); mysql_select_db($database_gepem, $gepem); $Result1 = mysql_query($insertSQL, $gepem) or die(mysql_error());$insertGoTo = "sucesso.php";if (isset($_SERVER['QUERY_STRING'])){$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";$insertGoTo .= $_SERVER['QUERY_STRING'];}header(sprintf("Location:%s",$insertGoTo));}
E que seja resolvido mais um mistério hihihiihi quanto antes eu resolver isso mais cedo paro de incomodá-los ehheeh B)Grde abraço e valeu por todas ajudas que já tive. B)
Carregando comentários...