Failed to load resource: the server responded with a status of 400 (Bad Request)
Ola pessoal estou desenvolvendo um site imobiliario e na area que lista os imóveis, não esta aparecendo as fotos dos imóveis. e esta gerando o seguinte erro
Failed to load resource: the server responded with a status of 400 (Bad Request) thumb.php
código onde mostra o caminho da imagem
<?php
/**
* descricao Imagem
*
* @author janaina
*/
class Fotos {
/*
* metodo para exibir a foto
* com varios tamanhos
*/
public static function Exibir($imagem, $w, $h,$f=null) {
if ($imagem == null):
$imagem = 'sem-foto.jpg';
endif;
if ($f != null && $f == true) {
$fotos = ".".Rotas::$siteUrl . Rotas::$pastaFotos . 'thumb.php?src=' . $imagem . '&w=' . $w . '&h=' . $h;
} else {
$fotos = Rotas::$siteUrl . Rotas::$pastaFotos . 'thumb.php?src=' . $imagem . '&w=' . $w . '&h=' . $h;
}
$img = '<img src="' . $fotos . '" >';
return $img;
// echo $fotos;
}
/**
*
* @param type $imagem
* @param type $w
* @param type $h
* @return string caminho da foto
* este é o metodo somente quando a imagem for link
*/
public static function ImagemLink($imagem, $w, $h) {
$fotos = Rotas::$siteUrl . Rotas::$pastaFotos . 'thumb.php?src=' . $imagem . '&w=' . $w . '&h=' . $h;
return $fotos;
// echo $fotos;
}
/**
* metodo que faz tratamento do upload
*/
public static function Upload() {
}
/**
* metodo que dele a foto da pasta
* @param type $arquivo (pega o nome da foto)
* e apaga da pasta
*/
public static function Apagar($arquivo=null) {
if(empty($arquivo)):
$arquivo = '00000.jpg';
endif;
$foto = $_SERVER['DOCUMENT_ROOT'] . '/' . Rotas::$pastaFotos . $arquivo;
// se a foto existe
if (file_exists($foto)):
unlink($foto); // apago ela da pasta
else:
echo '<br><center><strong>Erro: Imagem inexistente</strong></center>';
endif;
}
}Discussão (1)
Carregando comentários...