duanjianao0592
duanjianao0592
2010-02-07 23:08
浏览 19
已采纳

为什么我一直收到错误说“291找不到文件#4.txt”?

I am working on a project to test if I can use SWFTools on my site. I have created this script to just display scrolling text on the screen of the user's choice.

All the information you need to know is below:

Additional Info that might help you: PHP info version info: PHP 5.2.12 (cli) (built: Dec 16 2009 17:03:10) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Server: XAMPP (apache, php, mysql, plus some others) on Microsoft Windows 7

SwfTools file: swfc.exe

SwfTools version: 0.9.0

My Project is made up of 2 php files: index.php makefile.php

Project Available at: http://ericlounge.host22.com/000/22014/allfiles.zip

error: "291Couldn't find file #4.txt"

file: /ProjectDirectory/index.php?filename=Test&text=Test+inverted+blend+mode...+ABCDEFGHIJKLMNOPQRSTUVWXYZ&image=1&makeswf=true

SwfTools SWFC documentation: http:// www.swftools.org/swfc/swfc.html

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • drno94939847
    drno94939847 2010-02-08 12:01
    已采纳

    I found the answer.

    I was using the variable "$file" twice. I set it here:
    $file = $_GET["filename"]; and here
    $file = fopen($file . ".txt","w");

    It was using the file from fopen because that was called last. In the end, it opened up a completely wrong file.

    点赞 评论
  • duanduji2986
    duanduji2986 2010-02-07 23:19

    IMO it happens here

    else
    {
     require("makefile.php");
    $file = $_GET["filename"];
    $text = $_GET["text"];
    $img  = $_GET["image"];
    $file = fopen($file . ".txt","w");
    echo fwrite($file, createswffile($file, $img, $text));
    fclose($file);
    system("swfc " . $file . ".txt");
    

    You are trying to open file which doesn't exist. I believe your $file contains 4 as the filename, which later on is used to open file.

    Try echo-ing the value of $file, and you'll see that its 4.

    Again, I just put skimmed through your code, without diving into details.

    点赞 评论

相关推荐