내 작품에 다른 웹 사이트를 복제하여 새 웹 사이트를 만들고 있는데 작성하거나 코딩하지 않았습니다.양식 작업이 PHP 파일로 리디렉션되지 않습니다
내 문제는 다음과 같습니다. 사이트가 작동하지만 이미지 업로드가 작동하지 않고 ideia가 발생하지 않습니다. var_dump와 같은 문제를 해결하기 위해 변수 디버깅을 시도해 보았습니다. 여기 코드는 다음과 같습니다
<? require_once("header.php"); ?>
<? require_once("menu.php"); ?>
<? require_once("ConnFile.php"); ?>
<?
if ($_GET["acao"] == "excluir")
{
$Tabela = "BannerHome";
$TabelaChave = "idBanner";
if(is_numeric($_GET["k"]))
{
$txtIdProduto = $_GET["k"];
$acao = ("UPDATE $Tabela SET Imagem". $_GET["I"] . " = '' WHERE $TabelaChave = $txtIdProduto ");
if(mysqli_query($link, $acao)) {
echo '<div class="alert alert-success alert-dismissible"" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> Registro removido com sucesso</div>';
} else {
echo '<div class="alert alert-danger alert-dismissible"" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> Não foi possível remover o registro. </div>';
}
}
}
?>
<?
$id = 0;
if(is_numeric($_GET["k"])) {
$id = $_GET["k"];
}
$DadosProduto = mysqli_fetch_array(mysqli_query($link, "SELECT * FROM BannerHome WHERE idBanner = " . $id));
?>
<? if($DadosProduto["Imagem" . $_GET["I"]] == "") { print '<div class="alert alert-warning alert-dismissible"" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> Este banner ainda não possui imagem cadastrada. </div>'; } ?>
<?
?>
<link href="upload/assets/css/style.css" rel="stylesheet" />
<h4>Banner home<small>/Imagems/<?=$DadosProduto["Titulo"]; ?> </small></h4>
<form class="form-horizontal" role="form" id="upload" action="upload/uploadHome.php?k=<?=$id; ?>&I=<?=$_GET['I']; ?>" method="post" enctype="multipart/form-data">
<div id="drop">
<pre>
<center>
Arreste as imagens (Fundo 1920x400, Superior 420x40)
<br>
ou
<br>
<a class="btn btn-primary btn-lg" >Selecione as imagens</a>
<input type="file" name="upl" multiple />
</div>
</center>
</pre>
<ul>
<!-- The file uploads will be shown here -->
</ul>
<div style="clear:both";>
<?
var_dump($DadosProduto);
if($DadosProduto["Imagem" . $_GET["I"]] != "") {
print '<div class="panel panel-default" style="width:145px; float:left; margin-right:4px;">';
print ' <div class="panel-body">';
print ' <img src="../gdThumb.php?imagem=' . $DadosProduto["Imagem" . $_GET["I"]] . '" alt="" class="img-thumbnail">';
print ' </div>';
print ' <div class="panel-footer"><center><a href="?acao=excluir&k='. $DadosProduto["idBanner"] .'&I='. $_GET["I"] .'"><span class="glyphicon glyphicon-remove"></span> Remover</a></center></div>';
print '</div> ';
}
?>
</div>
</form>
<script src="upload/assets/js/jquery.knob.js"></script>
<!-- jQuery File Upload Dependencies -->
<script src="upload/assets/js/jquery.ui.widget.js"></script>
<script src="upload/assets/js/jquery.iframe-transport.js"></script>
<script src="upload/assets/js/jquery.fileupload.js"></script>
<!-- Our main JS file -->
<script src="upload/assets/js/script.js"></script>
<? require_once("footer.php"); ?>
나는 문제가 양식 작업을
<form class="form-horizontal" role="form" id="upload" action="upload/uploadHome.php?k=<?=$id; ?>&I=<?=$_GET['I']; ?>" method="post" enctype="multipart/form-data">
업로드 폴더가 존재하기 때문에 너무 PHP 파일에서 생각합니다. 그러나 양식에서이 작업을 호출하면 아무 일도 일어나지 않습니다. 내가 사용하려고 : var_dump, 죽을(), 에코, 많은 것들을 간단한 반응을 볼 수 있습니다. uploadHome.php를 디버깅 할 수 없습니다. 왜 그런지 모르겠습니다.
connFile.php는
그래서, 나는 내 이미지를 저장하기 위해이 페이지를 호출 할 필요가 작동하고 페이지가 호출되지 않습니다. 여기에 uploadHome.php이다 : 나는 어떻게 해야할지 모르기 때문에 당신이 나를 제공 할 수
<? require_once("../ConnFile.php"); ?>
<?php
$idProduto = $_GET["k"];
// A list of permitted file extensions
$allowed = array('png', 'jpg', 'gif','zip');
if(isset($_FILES['upl']) && $_FILES['upl']['error'] == 0){
$extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION);
if(!in_array(strtolower($extension), $allowed)){
echo '{"status":"error"}';
exit;
}
$arquivo = 'BannerHome_'. $_GET["k"] . '_' . rand(1,1500) . '-' . md5($_FILES['upl']['name']) . "." . $extension;
if(move_uploaded_file($_FILES['upl']['tmp_name'], '../../img/produto/'. $arquivo)){
mysqli_query($link, "UPDATE BannerHome SET Imagem". $_GET['I'] ." = '$arquivo' WHERE idBanner = " . $_GET["k"]);
echo '{"status":"success"}';
exit;
}
}
echo '{"status":"error"}';
exit;
모든 정보는 크게 감상 할 수있다.
[SQL 주입 공격] (http://bobby-tables.com)에 취약합니다. 돈을 빌려서 돈을 버는 경우 돈을 두 배로 늘려야합니다. –
나는 이것들에 세미콜론이 필요하다고 생각하지 않는다.' = $ _ GET [ 'I']; ? >'지금은 테스트 할 수 없지만 그 문법을 사용한 적이 몇 번 있었는데 나는 그것이 ''이라고 생각했습니다 .. 그리고 어느 쪽인지를 확인하는 정보를 찾지 못했습니다 :/ –
제가 문제라고 생각합니다 : UploadHome.php가 submitid, 어떤 ideias를 호출하지 않습니다? –