Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá!
estou fazendo um galeria de fotos... em que o usuario se for cadastrado pode enviar fotos......
ja usei o mesmo método de session para a parte de administracao de outro site....
soh que nesse está dando o erro:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/s65473/public_html/galeria/enviarfotos/enviarfoto.php:1) in /home/s65473/public_html/galeria/enviarfotos/enviarfoto.php on line 2
observem o codigo:
<?php
session_start();
//if (!isset($_SESSION)){ session_start(); } esse também da erro
require_once('../conexao.php');
require_once('../ScriptLibrary/incPureUpload.php');
require_once('../ScriptLibrary/incResize.php');
require_once('../ScriptLibrary/incPUAddOn.php');
// Pure PHP Upload 2.1.2
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu = new pureFileUpload();
$ppu->path = "../imagens/ENVIADAS";
$ppu->extensions = "GIF,JPG,JPEG,BMP,PNG";
$ppu->formName = "enviar_fotos";
$ppu->storeType = "file";
$ppu->sizeLimit = "2000";
$ppu->nameConflict = "uniq";
$ppu->requireUpload = "true";
$ppu->minWidth = "";
$ppu->minHeight = "";
$ppu->maxWidth = "";
$ppu->maxHeight = "";
$ppu->saveWidth = "";
$ppu->saveHeight = "";
$ppu->timeout = "600";
$ppu->progressBar = "fileCopyProgress.htm";
$ppu->progressWidth = "300";
$ppu->progressHeight = "100";
$ppu->checkVersion("2.1.2");
$ppu->doUpload();
}
$GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF']; $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true";
} else {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];
} $GP_uploadAction .= "?"."GP_upload=true";
}
// Rename Uploaded Files Addon 1.0.3
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ruf = new renameUploadedFiles($ppu);
$ruf->renameMask = "foto_enviada.jpg";
$ruf->checkVersion("1.0.3");
$ruf->doRename();
}
// Smart Image Processor 1.0.3
if (isset($HTTP_GET_VARS['GP_upload'])) {
$sip = new resizeUploadedFiles($ppu);
$sip->component = "GD";
$sip->resizeImages = "true";
$sip->aspectImages = "true";
$sip->maxWidth = "670";
$sip->maxHeight = "503";
$sip->quality = "80";
$sip->makeThumb = "true";
$sip->pathThumb = "../imagens/ENVIADAS/minis";
$sip->aspectThumb = "true";
$sip->naming = "suffix";
$sip->suffix = "";
$sip->maxWidthThumb = "100";
$sip->maxHeightThumb = "75";
$sip->qualityThumb = "70";
$sip->checkVersion("1.0.3");
$sip->doResize();
}
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;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
}
} else {
$editFormAction .= "?GP_upload=true";
}
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "enviar_fotos")) {
$insertSQL = sprintf("INSERT INTO subsolo_galeriaEnviadas (ID, Foto, `Desc`) VALUES (%s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['ID'], "text"),
GetSQLValueString($HTTP_POST_VARS['Foto'], "text"),
GetSQLValueString($HTTP_POST_VARS['Desc'], "text"));
mysql_select_db($database_conection, $conection);
$Result1 = mysql_query($insertSQL, $conection) or die(mysql_error());
?><script language="JavaScript">
<!--
window.location.href = "enviarfoto.php";
//-->
</script><?
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">.style7 { font-size: 18px;
font-family: Geneva, Arial, Helvetica, sans-serif;
}</style>
<script language='javascript' src='../../ScriptLibrary/incPureUpload.js'></script>
</head>
<body>
<table width="485" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="485" colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="center">
<? $login = $_SESSION["login"];
if(!isset($_SESSION["login"])) {
$sql = mysql_query("SELECT * FROM subsolo_usuarios WHERE login = '$login'"); // seleciona sql
echo "<br /><br /><p>você n ta logado</p><br />";
}
else { ?>
<form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="enviar_fotos" id="enviar_fotos" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,2000,'','','','','','');showProgressWindow('fileCopyProgress.htm',300,100);return document.MM_returnValue">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="107" align="right"><span class="style5">Descrição da Foto:</span></td>
<td width="24"> </td>
<td width="354"><input name="Desc" type="text" id="Desc" size="40" /></td>
</tr>
<tr>
<td width="107" align="right"><span class="style5">Foto:</span></td>
<td width="24"> </td>
<td><input name="Foto" type="file" id="Foto" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,2000,'','','','','','')" size="40" />
<input name="login" type="hidden" id="login" value="<?php echo $row_rsEnviadas['login']; ?>" /></td>
</tr>
<tr>
<td width="107" align="right"><span class="style6"></span></td>
<td width="24"> </td>
<td><input type="submit" name="btn_adicionarfoto" id="btn_adicionarfoto" value="Adicionar Foto" />
<?
}
?>
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="enviar_fotos">
</form></td>
</tr>
</table>
</body>
</html>
<?php
mysql_close();
?>
alguem pode me ajudar?!?!?
Carregando comentários...