
Ana Gabriela Raitz
Membros-
Total de itens
7 -
Registro em
-
Última visita
Sobre Ana Gabriela Raitz

Ana Gabriela Raitz's Achievements
0
Reputação
-
Erro ao fazer upload de imagem
pergunta respondeu ao Ana Gabriela Raitz de Ana Gabriela Raitz em PHP
Sim aparece somente o erro e a imagem é carregada corretamente. Vou verificar as permissoes da pasta. -
Boa tarde pessoal estou com um erro ao fazer um upload de imagem para o servidor. O erro é: Checking propertyphoto3$_FILES [ propertyphoto3 ] [ "error" ] = 0 (UPLOAD_ERR_OK = 0) Segue abaixo o fonte: <?php require ( "../includes/config.php" ); require ( "../includes/CGI.php" ); require ( "../includes/SQL.php" ); $cgi = new CGI (); $sql = new SQL ( $DBusername, $DBpassword, $server, $database ); if ( ! $sql->isConnected () ) { die ( $DatabaseError ); } ?> <html> <head> <title>Adicionar Imagem</title> <link href="style.css" rel="stylesheet" type="text/css" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <? require ( "resizer.php" ); require ( "../includes/CSQL.php" ); if ( $cgi->getValue ( "Submit" ) == 'Atualizar Imagem' ) { $img = $cgi->getValue ( "img" ); $propertyphotos [ $img ] = ""; $t = "propertyphoto" . $img; error_log ( "Checking propertyphoto" . $img ); if ( ! isset ( $_FILES [ $t ] ) || ! is_uploaded_file ( $_FILES [ $t ] [ 'tmp_name' ] ) ) { error_log ( "Breaking, no uploaded file?" ); print "<br><p align=\"center\"><strong>No Image Uploaded</strong></p>"; } error_log ( "\$_FILES [ " . $t . " ] [ \"error\" ] = " . $_FILES [ $t ] [ "error" ] . " (UPLOAD_ERR_OK = " . UPLOAD_ERR_OK . ")" ); if ( $_FILES [ $t ] [ "error" ] == UPLOAD_ERR_OK ) { $tmp_name = $_FILES [ $t ] [ "tmp_name" ]; $name = $_FILES [ $t ] [ "name" ]; $propertyphotos = $_POST [ 'ref' ] . "-" . $img . "-" . $name; ResizeConserveAspectRatio($tmp_name, $ImagePath . "/" . $propertyphotos, $max_image_resize_width); } $sql_update = "UPDATE " . $property_table . " SET propertyphoto" . $img . "=" . $sql->quote ( $propertyphotos ) . " WHERE id=" . $sql->quote ( $cgi->getValue ( "id" ) ); $rows = $sql->execute ( $sql_update ); ?> <p> </p> <p align="center"> Atualizado <br /> <a href="#" onClick="opener.location.reload( true );window.close();">Fechar e voltar</a></p> <br /> <? } else { ?> <h2 align="left"><img src="images/spacer.gif" height="10" width="15" /> Adicionar Imagem <?php echo $cgi->htmlEncode ( $cgi->getValue ( "img" ) ); ?></h2> <p>Use o campo abaico para escolhaer uma nova imagem.</p> <form method="post" enctype="multipart/form-data" id="add image"> <input type="hidden" name="img" value="<?php echo $cgi->htmlEncode ( $cgi->getValue ( 'img' ) ); ?>" /> <input type="hidden" name="id" value="<?php echo $cgi->htmlEncode ( $cgi->getValue ( 'id' ) ); ?>" /> <input type="hidden" name="ref" value="<?php echo $cgi->htmlEncode ( $cgi->getValue ( 'ref' ) ); ?>" /> <input type="file" name="propertyphoto<?php echo $cgi->htmlEncode ( $cgi->getValue ( 'img' ) ); ?>" /> <br /> <br> <input type="submit" name="Submit" value="Atualizar Imagem" /> </form> <? } ?> </body> </html> Alguém tem ideia do que pode estar ocorrendo?
-
Boa tarde a todos, estou com dificuldades em fazer uma busca em php retornar os valores. Tenho a tela de busca onde informo o dado que quero buscar, o codigo é: <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Objetos que passaram pelo satelite</title> <style type="text/css"> <!-- .dados { color: #1866E7; font-size: 24px; } --> </style></head> <body> <form action="resultado_objetosat.php" method="get" name="form1" id="form1"> <table width="700" border="0"> <tr></tr> <tr></tr> <tr> <td width="400" class="dados">Digite o nome do Satélite:</td> <td width="361"><label> <input type="text" name="buscaob" id="buscaob" /> </label></td> <td width="226"><label> <input name="Submit" type="submit" id="Submit" value="Buscar no site" /> </label></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form> </body> </html> E minha pagina de resultado que não retorna nada é: <?php require_once('Connections/ConnCatalogo.php'); ?> <?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; } } $buscaob_rs_buscaobjeto = "-1"; if (isset($_GET['buscaob'])) { $buscaob_rs_buscaobjeto = $_GET['buscaob']; } mysql_select_db($database_ConnCatalogo, $ConnCatalogo); $rs_buscaobjeto = mysql_query("SELECT passagem.objeto, passagem.dia_pass, passagem.mes_pass, passagem.ano_pass FROM passagem WHERE passagem.nome like '%buscaob_rs_buscaobjeto%' ORDER BY passagem.nome") or die(mysql_error()); $row_rs_buscaobjeto = mysql_fetch_assoc($rs_buscaobjeto); $totalRows_rs_buscaobjeto = mysql_num_rows($rs_buscaobjeto); ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento sem título</title> <style type="text/css"> <!-- .impressao { font-size: 16px; color: #0CC; } .impressao a strong { color: #00F; font-size: 24px; } .Titulo { font-family: "Arial Black", Gadget, sans-serif; font-size: 36px; color: #00F; text-align: left; } .dados { color: #1866E7; font-size: 24px; } --> </style></head> <body> <form id="form1" name="form1" method="post" action=""> <p class="Titulo">Lista Objetos</p> <table width="883" border%3
-
-
Boa tarde fiz o teste seguindo o seguinte script: <?php require_once 'fpdf.php'; // instanciando o objeto $meu_pdf = new FPDF('P', 'cm', 'A4'); // adicionando uma página $meu_pdf -> AddPage('P'); // 'P' para formato retrato // definindo as margens $meu_pdf -> SetMargins(2.5, 2.5); // lembre-se que definimos a unidade de medida como centímetros // configurando o texto $meu_pdf -> SetFont("times", "BI", "cm", 18); // Times New Roman tamanho 18, em negrito e itálico $meu_pdf -> SetTextColor(0, 0, 255); // azul $meu_pdf -> SetXY(4, 4); // a 4 centímetros da esquerda e do topo // escrevendo $meu_pdf -> Write(0.5, "Criando PDFs com "); // escrevendo e criando um link $meu_pdf -> Write(0.5, "PHP", "http://www.php.net"); // quebrando a linha, duas vezes $meu_pdf -> Ln(); $meu_pdf -> Ln(); // adicionando mais texto $meu_pdf -> Write(0.5, "Não é tão complicado!!"); // $meu_pdf -> Close(); // gerando a saída $meu_pdf -> Output("teste", "I"); ?> Porém da o seguinte erro: Warning: Cannot modify header information - headers already sent by (output started at C:\Arquivos de programas\VertrigoServ\www\bu\teste2.php:1) in C:\Arquivos de programas\VertrigoServ\www\bu\fpdf.php on line 1017 FPDF error: Some data has already been output, can't send PDF file Já procurei em alguns sites mas não consegui resolver ainda, alguém pode me ajudar?
-
Boa tarde fiz o teste seguindo o seguinte script: <?php require_once 'fpdf.php'; // instanciando o objeto $meu_pdf = new FPDF('P', 'cm', 'A4'); // adicionando uma página $meu_pdf -> AddPage('P'); // 'P' para formato retrato // definindo as margens $meu_pdf -> SetMargins(2.5, 2.5); // lembre-se que definimos a unidade de medida como centímetros // configurando o texto $meu_pdf -> SetFont("times", "BI", "cm", 18); // Times New Roman tamanho 18, em negrito e itálico $meu_pdf -> SetTextColor(0, 0, 255); // azul $meu_pdf -> SetXY(4, 4); // a 4 centímetros da esquerda e do topo // escrevendo $meu_pdf -> Write(0.5, "Criando PDFs com "); // escrevendo e criando um link $meu_pdf -> Write(0.5, "PHP", "http://www.php.net"); // quebrando a linha, duas vezes $meu_pdf -> Ln(); $meu_pdf -> Ln(); // adicionando mais texto $meu_pdf -> Write(0.5, "Não é tão complicado!!"); // $meu_pdf -> Close(); // gerando a saída $meu_pdf -> Output("teste", "I"); ?> Porém da o seguinte erro: Warning: Cannot modify header information - headers already sent by (output started at C:\Arquivos de programas\VertrigoServ\www\bu\teste2.php:1) in C:\Arquivos de programas\VertrigoServ\www\bu\fpdf.php on line 1017 FPDF error: Some data has already been output, can't send PDF file Já procurei em alguns sites mas não consegui resolver ainda, alguém pode me ajudar?
-
Boa noite estou fazendo meu TCC da faculdade e estou com alguns problemas, criei uma página de busca no meu banco mysql que retorna os dados que preciso para a tela, porem eu preciso que tenha um botão impressao que imprima tal relatorio em formato doc, pdf, algo do genero e não consigo nenhuma dica na net de como fazer. Alguém pode me ajudar??? Estou usando o Dreamweaver com o PHP e Mysql. Desde já agradeço.