老大不是我想用呀。是人家要这么用的。产品最后的使用的平台是php-3.0.9,我现在都找不到这个了,就用php-3.0.17来替代它的,想不到遇到了问题。

解决方案 »

  1.   

    这三行代码中有php代码吗?
    你确定是php的错吗?
      

  2.   

    没说清楚。php-3.0.17以cgi的方式运行。执行时就非法操作。
      

  3.   

    那样的话就很有可能是版本的问题了~~我对cgi也不是很熟~~那么古老那么麻烦的东西~这些还有人学吗?
      

  4.   

    就是执行upload.php3的时候了。upload.php3里面不需要代码,只要提交了,就有错误,但是表单不用enctype=multipart/form-data就没有任何问题了。
      

  5.   

    再次发现自己的浅薄enctype=multipart/form-data是用来做什么的?
      

  6.   

    我是用的php4中的一套ftp函数,不知道php3有没有
      

  7.   

    大致有这么些函数ftp_pwd — Returns the current directory name
    ftp_cdup — Changes to the parent directory
    ftp_chdir — Changes directories on a FTP server
    ftp_mkdir — Creates a directory
    ftp_rmdir — Removes a directory
    ftp_nlist — Returns a list of files in the given directory.然后上传代码是<?php
    // set up basic connection
    $conn_id = ftp_connect("$ftp_server"); // login with username and password
    $login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass"); // check connection
    if ((!$conn_id) &brvbar;&brvbar; (!$login_result)) { 
            echo "Ftp connection has failed!";
            echo "Attempted to connect to $ftp_server for user $user"; 
            die; 
        } else {
            echo "Connected to $ftp_server, for user $user";
        }// upload the file
    $upload = ftp_put($conn_id, "$destination_file", "$source_file", FTP_BINARY); // check upload status
    if (!$upload) { 
            echo "Ftp upload has failed!";
        } else {
            echo "Uploaded $source_file to $ftp_server as $destination_file";
        }// close the FTP stream 
    ftp_quit($conn_id); 
    ?>
      

  8.   

    <form name="form1" enctype="multipart/form-data" method="post" action="upload.php" OnSubmit="return checksubmit();">
    <input type="hidden" name="MAX_FILE_SIZE" value="10485760">
    <input type="hidden" name="mid" value="<?php echo $mid; ?>">
    <INPUT TYPE="hidden" name="besubmit" value="1">
    <table width="98%" border="0" cellspacing="0" cellpadding="0" class="s6" align="center">
      <tr> 
        <td align="left" valign="top" width="11%"><img src="t4.gif" width="2" height="2"></td>
        <td align="right" valign="top" width="89%"><img src="t7.gif" width="2" height="2"></td>
      </tr>
      <tr valign="top"> 
        <td colspan="2" align="left" height="183">
      <table width="98%" border="0" cellspacing="1" cellpadding="0" align="center">
        <tr>
      <td width="50%">您正在<b>[ <?php echo $label; ?> ]</b>栏目中上载作品</td>
      <td align=left><b>上载声明:</b></td>
    </tr>
        <tr>
      <td><?php if ($mid!='pic') { ?>文件:<input name="upfile" type="file" class="box1"> <?php } ?></td>
      <td></td>
    </tr>
    <tr>
      <td>图片:<input name="upimg" type="file" class="box1"></td>
      <td rowspan="6" valign="top">
         1. 我们将认真对待每一个作品。<br>
    2. 只有经过审批合格才给予发布,请在[待审作品]中查看您的上传。<br>
    3. 所有作品不用于商业用途。<br>
    4. 文件大小限制在10M以内。<br>
    5. 支持以下文件格式:<?php echo str_replace('|',',',$exts[$mid]); ?>。<br>
    6. 支持以下图片格式:<?php echo str_replace('|',',',$exts['pic']); ?>。<br>
    7. 为了方面我们也方便大家,请填写每一项内容。<br>
    8. 支持HTML描述。
      </td>
    </tr>
    <tr><td>名称:<input name="name" type="text" value="<?php echo $name; ?>" class="box1"></td></tr>
    <tr><td>
    分类:<SELECT NAME="cid" class="box1">
    这里你可以自己写option
      </SELECT>
    </td></tr>
    <tr><td>来源:<input name="source" type="text" value="<?php echo $source; ?>" class="box1"></td></tr>
    <tr><td>姓名:<input name="upman" type="text" value="<?php echo $upman; ?>" class="box1"></td></tr>
    <tr><td>简介:<br><TEXTAREA NAME="intro" ROWS="5" COLS="35" class="box2"></TEXTAREA></td></tr>
    <tr>
      <td><INPUT TYPE="submit" name="submit" value=" 上 传 " class="box2"> <INPUT TYPE="reset" value=" 清 除 " class="box2"></td>
      <td align=right>[<a href="#" onClick="window.close()">关闭窗口</a>]</td>
    </tr>
      </table>
    </td>
      </tr>
      <tr> 
        <td align="left" valign="bottom" width="11%"><img src="t5.gif" width="2" height="2"></td>
        <td align="right" valign="bottom" width="89%"><img src="t6.gif" width="2" height="2"></td>
      </tr>
    </table>
    </form>这是我以前用~~好象是这一段
      

  9.   

    好象你要改的部分不少,凡是有php脚本的地方你都需要改成你自己的东西
      

  10.   

    是呀,你这里不是有enctype="multipart/form-data"这部分嘛。怎么告诉我没用过呢?
      

  11.   

    分特~~自己都忘了~~我的环境是php4+apache,运行没有问题~~所以我想应该不是你的程序的问题