毕业设计要做一个管理毕业论文的系统,要求学生能将doc格式的毕业论文上传,而导师能将论文下载下来,请问具体的代码要怎样写?PHPMySQL上传 下载上传下载

解决方案 »

  1.   

    上传就是提交表单嘛
    <input type='file' name='upload'/>处理提交的表单将上传文件处理存在一个路径下,然后将路径存在数据库里,然后再将论文路径的链接呈现给导师,他一点击就可以下载了
      

  2.   

    查查PHP的超全局数组$_FILES的用法吧手册上有现成的例子网上有现成封装好的文件上传类!
      

  3.   

    学生页面 student.php
    <?php
    if($_FILES && $_POST['StudentID']) {
      if(strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION)) == 'doc') {
        move_uploaded_file($_FILES['file']['tmp_name'], $_POST['StudentID'].'.doc');
        echo '上传成功,玩去吧!';
      }
    }
    ?>
    <form method="POST" enctype="multipart/form-data">
    <input type=text name=StudentID /><br> 
    <input type=file name=file /><br> 
    <input type=submit value=提交>
    </form>导师页面 tutor.php
    <?php
    foreach(glob('*.doc') as $fn) {
      echo "<a href='$fn'>" . substr($fn, 0, -4) . '</a><br />';
    }
    这是基本代码,自己扩充去吧!