Opa...
algumas paginas do meu site estão com um erro no topo ao abrir... gostaria de saber qual a possivel solução...
o erro é :
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/expertizeti/www/validar_user.php:2) in /home/expertizeti/www/Cadastro/impressora_cadastro.php on line 4
a pag eh a seguinte...
<? include "../validar_user.php" ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "admin";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../acesso_fall.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
$.mask.masks = $.extend($.mask.masks,{
ip:{ mask: '999.999.999.999' },
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ExpertizeTI | Cadastro de Computadores</title>
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>
<script type="text/javascript">
(function($){
$(
function(){
$('input:text').setMask();
}
);
})(jQuery);
</script>
<script type="text/javascript" src="js/jquery.meio.mask.js">
</script>
<link rel="stylesheet" href="css/general.css" type="text/css" media="screen" />
<!--[if IE 6]>
<link rel="stylesheet" href="css/ie6.css" type="text/css" media="screen," />
<![endif]-->
</head>
<body>
<table width="80%" border="0" align="center">
<tr>
<td>
<style type="text/css">
body{background:#000;}
body h1{ font: 22px "Trebuchet MS", Arial, Helvetica, sans-serif; color:#CCC; font-weight:bold; text-align:center}
strong{font: 16px "MS Serif", "New York", serif; color:#FFF; font-weight:bold;}
span{font: 20px "MS Serif", "New York", serif; color:#FFF; font-weight:bold;}
#cadastra{ background:#333;-moz-border-radius: 10px; /* Para Firefox */
-webkit-border-radius: 10px; /*Para Safari e Chrome */
border-radius: 10px; /* Para Opera 10.5+*/;}
label{display:block; margin: 10px 0px 15px 40px;}
select{font:16px "Trebuchet MS", Arial, Helvetica, sans-serif; color:#CCC; font-weight:bold; background:#111; border:none; cursor:pointer;-moz-border-radius: 6px; /* Para Firefox */
-webkit-border-radius: 6px; /*Para Safari e Chrome */
border-radius: 6px; /* Para Opera 10.5+*/;}
input{font:16px "Trebuchet MS", Arial, Helvetica, sans-serif; color:#CCC; font-weight:bold; background:#111; cursor:pointer;-moz-border-radius: 4px; /* Para Firefox */
-webkit-border-radius: 6px; /*Para Safari e Chrome */
border-radius: 6px; /* Para Opera 10.5+*/;}
#modeloZero{display:inline; margin: 10px 0px 15px 40px;}
#modeloUm{display:inline; margin: 10px 0px 15px 20px;}
#modeloDois{display:block; margin: 1px 0px 5px 40px;}
</style>
<?php include "../menu_superior.php"; ?>
<h1>ExpertizeTI - Impressoras</h1>
<?php
$cadastroId = $_GET['cadastroId'];
$sql_pegaAtivos = 'SELECT * FROM cadastro_placamae WHERE cadastroId = :cadastroId';
try{
$query_pegaAtivos = $conecta->prepare($sql_pegaAtivos);
$query_pegaAtivos->bindValue(':cadastroId',$cadastroId,PDO::PARAM_STR);
$query_pegaAtivos->execute();
$resultado_pegaAtivos = $query_pegaAtivos->fetchAll(PDO::FETCH_ASSOC);
}catch(PDOexception $error_pegaAtivos){
echo 'Erro ao pegar ativos';
}
foreach($resultado_pegaAtivos as $resAtivos){
$clienteCadastro = $resAtivos['clienteCadastro'];
$cadastroArquitetura = $resAtivos['cadastroArquitetura'];
$fabricante = $resAtivos['fabricante'];
$modelo = $resAtivos['modelo'];
$versao = $resAtivos['versao'];
$cadastroModelo = $resAtivos['cadastroModelo'];
$cadastroProcessadores = $resAtivos['cadastroProcessadores'];
$PCI_Ex16 = $resAtivos['PCI_Ex16'];
$PCI_Ex16_uso = $resAtivos['PCI_Ex16_uso'];
$PCI_Ex4 = $resAtivos['PCI_Ex4'];
$PCI_Ex4_uso = $resAtivos['PCI_Ex4_uso'];
$PCI22 = $resAtivos['PCI22'];
$PCI22_uso = $resAtivos['PCI22_uso'];
$AGP4x_8x = $resAtivos['AGP4x_8x'];
$AGP4x_8x_uso = $resAtivos['AGP4x_8x_uso'];
$AGP1x_2x = $resAtivos['AGP1x_2x'];
$AGP1x_2x_uso = $resAtivos['AGP1x_2x_uso'];
$memoriaSlots = $resAtivos['memoriaSlots'];
$memoriaTipo = $resAtivos['memoriaTipo'];
$memoriaBarramento = $resAtivos['memoriaBarramento'];
$sata = $resAtivos['sata'];
$raid = $resAtivos['raid'];
$pata = $resAtivos['pata'];
$armazenamentoDriver1 = $resAtivos['armazenamentoDriver1'];
$armazenamentoInterface1 = $resAtivos['armazenamentoInterface1'];
$armazenamentoDescricao1 = $resAtivos['armazenamentoDescricao1'];
$armazenamentoDriver2 = $resAtivos['armazenamentoDriver2'];
$armazenamentoInterface2 = $resAtivos['armazenamentoInterface2'];
$armazenamentoDescricao2 = $resAtivos['armazenamentoDescricao2'];
$armazenamentoDriver3 = $resAtivos['armazenamentoDriver3'];
$armazenamentoInterface3 = $resAtivos['armazenamentoInterface3'];
$armazenamentoDescricao3 = $resAtivos['armazenamentoDescricao3'];
$armazenamentoDriver4 = $resAtivos['armazenamentoDriver4'];
$armazenamentoInterface4 = $resAtivos['armazenamentoInterface4'];
$armazenamentoDescricao4 = $resAtivos['armazenamentoDescricao4'];
$monitorTipo = $resAtivos['monitorTipo'];
$monitorPolegadas = $resAtivos['monitorPolegadas'];
$tipoRede = $resAtivos['tipoRede'];
$frequenciaRede = $resAtivos['frequenciaRede'];
$ssidRede = $resAtivos['ssidRede'];
$senhaRede = $resAtivos['senhaRede'];
$ipRede = $resAtivos['ipRede'];
$protocoloRede = $resAtivos['protocoloRede'];
$mascaraRede = $resAtivos['mascaraRede'];
$gatewayRede = $resAtivos['gatewayRede'];
$dnsum_rede = $resAtivos['dnsum_rede'];
$dnsdois_rede = $resAtivos['dnsdois_rede'];
$cadastroRede = $resAtivos['cadastroRede'];
$cadastroVideo = $resAtivos['cadastroVideo'];
$cadastroAudio = $resAtivos['cadastroAudio'];
$redeFile = $resAtivos['redeFile'];
$videoFile = $resAtivos['videoFile'];
$audioFile = $resAtivos['audioFile'];
$cadastroChipset = $resAtivos['cadastroChipset'];
}
?>
<div id="consulta">
<form action="" method="post" enctype="multipart/form-data" name="cadastro">
<label>
<input name="p" type="text" size="76" />
<input name="pesquisar" type="submit" id="pesquisar" value="Pesquisar" />
</label>
</form>
</head>
<body>
<div id="container">
<ul class="menu">
<li id="news" class="active">Cadastro</li>
</ul>
<span class="clear"></span>
<div class="content news">
<h1>Cadastro de Impressoras</h1>
<form id="form1" name="form1" method="post" action="enviar_impressora.php">
<label>
<span>Cliente:</span>
<select name="donoPC" size="1">
<option selected="" disabled="disabled">Selecione o Cliente</option>
<?php
require_once '../conexao.php';
$nome = mysql_query("SELECT * FROM cadastro_cliente")or die(mysql_error());
if(mysql_num_rows($nome) > 0)
{
while($ver = mysql_fetch_array($nome))
{
?>
<option value="<?php print $ver['clienteNome']; ?>"><?php print $ver['clienteNome']; ?></option>
<?php
}
}else{
print 'Não há registros';
}
?>
</select>
</label>
<label>
<span>Marca:</span>
<input name="marca" type="text" size="46"/>
</label>
<label>
<span>Modelo:</span>
<input name="modelo" type="text" size="45"/>
</label>
<label>
<span>Interface:</span>
<input name="interfaceUsb" type="checkbox" value="x" /><strong>Usb</strong>
<input name="interfaceRede" type="checkbox" value="x" /><strong>Rede</strong>
<input name="interfaceLpt" type="checkbox" value="x" /><strong>Lpt</strong>
</label>
<label>
<span>Codigo do Toner:</span>
<input name="toner" type="text" size="35"/>
</label>
<label>
<span>Rotatividade do Toner:</span>
<input name="rotatividade" type="text" size="29"/>
</label>
<label>
<span>Nome da impressora:</span>
<input name="nome_impress" type="text" size="31"/>
</label>
<label>
<span>Compartilhada em Rede:</span>
<input name="compartilhada" type="radio" value="Sim" /><strong>Sim</strong>
<input name="compartilhada" type="radio" value="Não" /><strong>Não</strong>
</label>
<label>
<span>IP caso for compartilhada em Rede:</span>
<input name="Ip_rede" type="text" size="16" alt="ip"/>
</label>
<label>
<span>Máscara de rede:</span>
<input name="mascara_rede" type="text" size="35"/>
</label>
<label>
<span>Driver: <br /></span>
<input name="driver" type="text" id="driver" size="40" />
<input name="driverfile" type="file" id="driverfile" />
</label>
<br />
<input id="cadastro_cad" name="Cadastrar" type="submit" value="Cadastrar"/>
</form>
</div>
<a href="#" onClick="history.go(-2)" style="cursor:pointer; text-decoration:none"><span>Voltar</span></a>
</div>
<script type="text/javascript" src="tabs.js"></script>
</body>
</html>
Valeeeu

Função Dando Erro
Started By Duh Sangali, 27/06/2011, 18:13
2 replies to this topic
#1
Posted 27/06/2011, 18:13
#2
Posted 27/06/2011, 18:40
A SESSION deve ser iniciada antes que haja qualquer saída para o navegador, ou seja, antes que qualquer coisa seja impressa na tela.
Tente colocar antes do include.
Se ainda permanecer o erro, poste o validar_user.php. Veja se lá você está inciando uma SESSION.
P.S.: Coloque sempre seus códigos entre as tags CODE do fórum para facilitar o leitura.
Tente colocar antes do include.
Se ainda permanecer o erro, poste o validar_user.php. Veja se lá você está inciando uma SESSION.
P.S.: Coloque sempre seus códigos entre as tags CODE do fórum para facilitar o leitura.
Edição feita por: Thiago Retondar, 27/06/2011, 18:46.
<!--
Blog OGordo: http://ogordo.com //Eu só escrevo aí, mas não sou gordo.
Twitter: @thiagoretondar
-->
Blog OGordo: http://ogordo.com //Eu só escrevo aí, mas não sou gordo.

Twitter: @thiagoretondar
-->
#3
Posted 28/06/2011, 14:38
Deu certo... era por que tinha arquivo antes da session mesmo...
brigadão aeee =]
brigadão aeee =]
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)