Haemp Posted May 8, 2008 Share Posted May 8, 2008 Hi guys. I have a site which displays different sections by requiering the correct .php according to $_GET, in the middle of the index.php. Now I have a upload function which use to work (before the require design) like this: upload.php (has form) action ----> uploader.php (has the uploading file code and a message). That worked like a charm. Now With the newer design I have the exact same code but with some re-arangements: upload.php(has form and regulated with an IF statement, has the uploading file code). Remember this is all being loaded from index.php ie. upload.php is recuired in index.php?view=upload. Here comes the mystery (for me): My $_FILES array comes up empty. I get the POST array but the FILES one is gone. Any ideas? Link to comment https://forums.phpfreaks.com/topic/104774-_file-and-require-mindnumbing/ Share on other sites More sharing options...
Fadion Posted May 8, 2008 Share Posted May 8, 2008 Simply u are including upload.php in index.php and upload.php has smth like: if(isset($_POST['somevalue'])){ $name = $_FILES['file']['name']; //blah blah } Has your form an enctype="multipart/form-data"?? Link to comment https://forums.phpfreaks.com/topic/104774-_file-and-require-mindnumbing/#findComment-536406 Share on other sites More sharing options...
Haemp Posted May 9, 2008 Author Share Posted May 9, 2008 Yup that's correct. Yes I have enctype="multipart/form-data". The code must be good because I can make it work without re-writing anything and simply "re-rout". Link to comment https://forums.phpfreaks.com/topic/104774-_file-and-require-mindnumbing/#findComment-536518 Share on other sites More sharing options...
Haemp Posted May 9, 2008 Author Share Posted May 9, 2008 *Update* So I re-wrote the script and now my FILES array is there and looking good. So the real problem with the previous script was premission. I got the Permission denied unlink.function. But I get it only when the files are displayed through the require script. Hope this helps... Link to comment https://forums.phpfreaks.com/topic/104774-_file-and-require-mindnumbing/#findComment-536568 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.