Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
xampp php文件上载错误_Php_Mysql_File Upload_Xampp - Fatal编程技术网

xampp php文件上载错误

xampp php文件上载错误,php,mysql,file-upload,xampp,Php,Mysql,File Upload,Xampp,我不知道我在php上上传的文件出了什么问题 php代码: <?php session_start(); if ($_SESSION['Loggedin']!="Yes") { header('location:index.php'); exit(); } require_once('Connect.php'); //This is the directory where images will be saved $target = "../htdocs/sites/tr

我不知道我在php上上传的文件出了什么问题

php代码:

<?php 
session_start();
if ($_SESSION['Loggedin']!="Yes") {
    header('location:index.php');
    exit();
}
require_once('Connect.php');

//This is the directory where images will be saved
$target = "../htdocs/sites/tryouts/newgames/images/main-news/";
$target = $target . basename( $_FILES['photo']['name']);

//This gets all the other information from the form
$author=$_POST['author'];
$title=$_POST['title'];
$pic=($_FILES['photo']['name']);
$bericht=$_POST['bericht'];



//Writes the information to the database
mysqli_query($Connection, "INSERT INTO nieuws (Nieuws_Author,Nieuws_Title,Nieuws_Image,Nieuws_Bericht)
VALUES ('$author', '$title', '$pic', '$bericht')") ;

//Writes the photo to the server
if(move_uploaded_file($_FILES['photo']['tmp_name'], $target))
{

//Tells you if its all ok
echo "The file ". basename( $_FILES['photo']['name']). " has been uploaded, and your information has been added to the directory";
}
else {

//Gives and error if its not
echo "Sorry, there was a problem uploading your file.";
}
  ?>
如果我们有

//This is the directory where images will be saved
$target = "../htdocs/sites/tryouts/newgames/images/main-news/";
错误呢

警告:移动上传的文件():无法移动 'C:\Users\xammp\tmp\php24D.tmp'”../htdocs/sites/tryouts/newgames/images/main news/bandicam2014-05-29 19-48-59-499.jpg'in C:\Users\xammp\htdocs\sites\tryouts\newgames\addnewscripts.php on 第26行抱歉,上载文件时出现问题

我想说的是,你需要改变你的道路

$target = "C:\Users\xammp\htdocs\sites\tryout\newgames\images\main-news\";

Windows路径与Unix路径混合在一起。这是否是Windows环境?是Windows 7 64位