코드를 변경하기 전에이 질문을했습니다. 이미지 업로드가 전혀 작동하지 않습니다. 사용자 이름 비밀번호를 확인했으며 루트가 모두 정확합니다. 내 코드는 오류를 표시하지 않습니다. 더 이상 무엇을 해야할지 모르겠지만 누군가 나를 도울 수 있습니까? 보안상의 이유로 연결을 변경했습니다.PHP 이미지 업로드가 작동하지 않습니다
<?php
$con = mysqli_connect("localhost", "torcdesi_jone45", "password", "torcdesi_amazing");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$query_image = 'INSERT INTO shirt_table (images3)
values("' . $_FILES['file3']['name'] . '")';
?>
<?php
include("configur.php");
if($_POST) {
// $_FILES["file"]["error"] is HTTP File Upload variables $_FILES["file"] "file" is the name of input field you have in form tag.
if ($_FILES["file3"]["error"] > 0) {
// if there is error in file uploading
echo "Return Code: " . $_FILES["file3"]["error"] . "<br />";
} else {
// check if file already exit in "images" folder.
if (file_exists("shirtimgs/" . $_FILES["file3"]["name"])) {
} else {
//move_uploaded_file function will upload your image.
if(move_uploaded_file($_FILES["file3"]["tmp_name"],"shirtimgs/" . $_FILES["file3"]["name"]))
{
// If file has uploaded successfully, store its name in data base
$query_image = "insert into shirt_table";
if(mysqli_query($link, $query_image)) {
echo "Stored in: " . "shirtimgs/" . $_FILES["file3"]["name"];
} else {
echo'';
}
}
}
}
}
?>
검사는 –
*는 * "나는 전에이 질문을했다"- 당신이 한 말인가요? http://stackoverflow.com/questions/41950688/image-name-will-not-upload-to-database - 그렇다면 재 게시로 간주됩니다. –
그리고 무엇이 빠졌는지 알고 있고 오히려 아주 간단하고 오류보고 및 매뉴얼을 읽는 것이 도움이되었을 것입니다. –