aiikcmo Posted February 14, 2008 Share Posted February 14, 2008 I have been at it for awhile now, it could be easy to fix but I don't see it. I'm having problems deleting and downloading files. I know that I can do this because it works great with Firefox. The problem is that when in any internet explore I try and download files or delete them I get warnings that result in no file paths or a failed function. I don't understand, I post my file path to the function. Here is the output and I tried to hardcode it once and it still failed. I'm going to assume the header errors are there because the previous function failed. $file = $_POST['file']; $size = filesize($file); $saveName = basename($file); .... Warning: filesize() [function.filesize]: stat failed for Download in /home/aiiam0/public_html/process.php on line 441 Warning: Cannot modify header information - headers already sent by (output started at /home/aiiam0/public_html/process.php:441) in /home/aiiam0/public_html/process.php on line 445 Warning: filemtime() [function.filemtime]: stat failed for Download in /home/aiiam0/public_html/process.php on line 449 Warning: Cannot modify header information - headers already sent by (output started at /home/aiiam0/public_html/process.php:441) in /home/aiiam0/public_html/process.php on line 449 $file = $_POST['file']; unlink( $file ); header("Location: download.php"); Warning: unlink(Delete) [function.unlink]: No such file or directory in /home/aiiam0/public_html/process.php on line 530 Warning: Cannot modify header information - headers already sent by (output started at /home/aiiam0/public_html/process.php:530) in /home/aiiam0/public_html/process.php on line 532 Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/ Share on other sites More sharing options...
Daniel0 Posted February 14, 2008 Share Posted February 14, 2008 See: http://www.phpfreaks.com/forums/index.php/topic,95562.0.html Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-466591 Share on other sites More sharing options...
aiikcmo Posted February 14, 2008 Author Share Posted February 14, 2008 Here is a the code take a look at the del function, I have commented out the header part and the error went away, for that, its like it dosen't see the file and after that if just dies on the header statements. My page sends to the process script and has NO whitespaces or html in it and then processes it. Warning: unlink(Delete) [function.unlink]: No such file or directory in /home/aiiam0/public_html/process.php on line 209 function procDeleteFile $file = $_POST['file']; unlink($file);//header("Location: download.php");//header("Location: ".$session->referrer);*This is LINE 209* Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467027 Share on other sites More sharing options...
Daniel0 Posted February 14, 2008 Share Posted February 14, 2008 Well, I'd say it's kind of self-explanatory. The file doesn't exist. Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467034 Share on other sites More sharing options...
revraz Posted February 14, 2008 Share Posted February 14, 2008 If it's on a different level than the script, provide the path to it. Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467041 Share on other sites More sharing options...
aiikcmo Posted February 15, 2008 Author Share Posted February 15, 2008 If it's on a different level than the script, provide the path to it. What do you mean, please explain a little. Yes, Daniel0 I agree with you, but what doesn't sit well with me is that it works in one browser and not the other browser. Is IE doing something diffrent with the path or post? I guess I will just move the code into the sending page to see if that makes a difference and I will have to write some test code to check to make sure the path from IE is good. Thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467284 Share on other sites More sharing options...
EchoFool Posted February 15, 2008 Share Posted February 15, 2008 If its not in the same folder as the script your running you have to add what folder its in. Say one file is in : main root - test .php (this file wants to file test3.php) main root - subfolder - test3.php (you put include("/subfolder/test3.php") ) But if you want to do the opposite so say test3 needs to find test you can do: include("../test.php"); As the .. will tell it to look in the main root folder. Of in your case its not include but "location" Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467290 Share on other sites More sharing options...
PFMaBiSmAd Posted February 15, 2008 Share Posted February 15, 2008 Echo $file to see what it actually contains. When a form submits different/wrong values from different browsers, it is usually because the html markup is invalid and one browser ignores the html errors and the other one does not. To get help with your form, you would need to post your code. Edit: The error message would seem to indicate that $file contains the word "delete" from IE. Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467291 Share on other sites More sharing options...
aiikcmo Posted February 15, 2008 Author Share Posted February 15, 2008 ok, here is my form/post code. Yes it seems that delete, the button name is being passed instead of the value, but this is my first website so yea, maybe I didn't use it correctly and Firefox was nice enough to post it. Its a mess to read because it is used in a loop for each file found in the folder. My idea was that I post it to a process file which is directed to the correct function by the hidden field and the value of post is used to produce the outcome. I'll I wanted was to have a named button to send a path to a function. <form action=\"process.php\" method=\"post\"><button name=\"file\" value=".($f."/".$item)." type=\"submit\">Delete</button><input type=\"hidden\" name=\"subdelete\" value=\"1\"></form> echo "<tr><td><b>$item</b></td><td><b>".round((filesize($f."/".$item)/1024),1)."</b></td><td><b>".date("m-d-y, g:i:sa", fileatime($f."/".$item))."</b></td><td><form action=\"process.php\" method=\"post\"><button name=\"file\" value=".($f."/".$item)." type=\"submit\">Download</button><input type=\"hidden\" name=\"subdownload\" value=\"1\"></form></td><td><form action=\"process.php\" method=\"post\"><button name=\"file\" value=".($f."/".$item)." type=\"submit\">Delete</button><input type=\"hidden\" name=\"subdelete\" value=\"1\"></form></td></tr>\n"; Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467428 Share on other sites More sharing options...
haku Posted February 15, 2008 Share Posted February 15, 2008 I'm not even going to try to look through that mess of code. You should format it (i.e. - don't put everything on one line), and use [code ] tags so that its easier for us to read. Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467442 Share on other sites More sharing options...
aiikcmo Posted February 15, 2008 Author Share Posted February 15, 2008 I know what is wrong. I'm using <button > instead of <input > and It doesn't give the same output with IE as Firefox does. RESOLVED Quote Link to comment https://forums.phpfreaks.com/topic/91027-works-in-firefox-but-not-in-windows-ie/#findComment-467447 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.