I was looking for a way to make a PHP script that uploads two files, edits them, then puts them in a zip along with other various files. I first found a tutorial on how to make zip files in PHP, and got a file with a class (you can see the source at: http://www.checkmyip.uni.cc/zip/class.zipfile.phps ) it ended up working great, so I used it. Now, I needed a way to upload files. I found another script which you can see the source at http://www.checkmyip.uni.cc/zip/upload_test.phps and you can see the fileupload class at http://www.checkmyip.uni.cc/zip/fileupload-class.phps

So now I was set. I made a simple form script to fit my needs ( http://www.checkmyip.uni.cc/zip/index_test.php / http://www.checkmyip.uni.cc/zip/index_test.phps ) and I was set to go. The only problem was that then uploader script for some reason wasn't working. It was working fine as the original script I downloaded, but now it wasn't working. And so now I don't know what's wrong. First it was returning an error that "No file was uploaded" or something, and now it's not working at all.

HELP, PLEASE! I am open to any suggestions. If you have any questions about the scripts, or why I did what I did in one script, just ask, I'll answer the best I can.

Thanks in advance for the help.

I changed this so that now the uploading and the file with the form are in the same file. upload_test.php is now not used. Although, it still doesn't work. Please help!

    You have to stop and figure out what changed when it stopped working all of a sudden like that... My guess is that your host probably upgraded their PHP (which turned off Register Globals), or they just shut it off.

    So, you should call your variables a little differently now. I can't get your source code because your phps files won't pull up for me, so I don't know what method you are using to submit the variables, so I am going to assume POST for the sake of this:

    Where you are looking for some variable passed by your form, you are probably calling them directly like so:
    $filename

    Well, if you POSTED the variable, you should call it like this now:
    $_POST['filename']

    This would be the first thing I would look into.

      Thanks for the quick reply... The thing is, my host didn't change at all. I did this within a span of 15 minutes. So I don't think it had anything to do with my host. I think the problem was that I didn't add "enctype="multipart/form-data"" to the form. For some reason now that I added it it seems to work. Thanks for the reply though. Please don't close this topic because I still have more errors with the script that I might be able to fix and might not. I'll post if I need anymore help.

        OK, sorry I misunderstood your original post... At any rate, since you started the thread, I can't resolve it, you'd have to. So take your time and resolve it whenever.

          OK. It seems that almost all my problems are gone. The only problem I'm getting now is a file_get_contents error when I try to edit the files. This seems to be because it's not uploading the second file. Any other help on this? I have updated the phps files with the latest source! Thanks in advance!

            Got it working 😃 When I added file_exists() it worked... weird...

              Write a Reply...