dpik71879 2013-01-09 05:04
浏览 36

FILE在服务器上传PHP mysql

I am trying to upload file by PHP mySQL.My script is perfectly working on localhost but in the server it is not working. It is not uploading file into server. Here is my action script.

//This is the directory where images will be saved 
$target1 = "notice/";
$target2 = "notice/"; 
$target3 = "notice/"; 
$target4 = "notice/";  

$target1 = $target1 . basename( $_FILES['photo1']['name']); 
$target2 = $target2 . basename( $_FILES['photo2']['name']);
$target3 = $target3 . basename( $_FILES['photo3']['name']);
$target4 = $target4 . basename( $_FILES['photo4']['name']);

 //This gets all the other information from the form 
$day=$_POST['day']; 
$month=$_POST['month']; 
$year=$_POST['year']; 
$title=$_POST['title'];
$dis=$_POST['dis'];
$pic1=($_FILES['photo1']['name']);
$pic2=($_FILES['photo2']['name']); 
$pic3=($_FILES['photo3']['name']); 
$pic4=($_FILES['photo4']['name']);  

// Connects to your Database 
mysql_connect("localhost", "root", "") or die(mysql_error()) ; 
mysql_select_db("trustcol") or die(mysql_error()) ; 

//Writes the information to the database 
mysql_query("INSERT INTO notice VALUES (NULL, '$day', '$month', '$year', '$title',          '$dis', '$pic1', '$pic2', '$pic3', '$pic4')") ; 

move_uploaded_file($_FILES['photo1']['tmp_name'], $target1);
move_uploaded_file($_FILES['photo2']['tmp_name'], $target2);
move_uploaded_file($_FILES['photo3']['tmp_name'], $target3);
move_uploaded_file($_FILES['photo4']['tmp_name'], $target4);
include('adminbanner.php'); 
include('adminmenu2.php');
?>

this is working on my PC/localhost perfectly but in the server it is not uploading files why?

  • 写回答

2条回答 默认 最新

  • doudu8291 2013-01-09 05:11
    关注
    1. Do you have file_uploads enabled in your php.ini (or using ini_set)?

    2. Is the filesize larger than the upload_max_filesize configuration option in php.ini?

    3. Look into these others, too: PHP.ini

      max_input_time, memory_limit, max_execution_time, and post_max_size

    4. Look for permission on the upload folder

    评论

报告相同问题?

悬赏问题

  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错