Hi,
Thanks for tutorials find them a great pace and full of useful stuff. however having some problems with the file upload tutorial. I don't think it is down to my code. I had put in all of the if(isset($_FILES ........... move_uploaded_file etc etc etc. However although the form displays fine, everytime I pressed the submit button, the browser went to an 'Internet Explorer cannot display this page' error. To try and see where it was going wrong I stripped code back and just did a print_r($_FILES) in the php section at top of page to check it was getting there but same error (also occurs in Chrome). I then got rid of the PHP section altogether and error continued. Therefore it seems as soon as I put an input with type file it fails on my computer.
If I do the same thing using text inputs and then use a print_r($_POST) this works fine so the problem seems to be around the file input.
Any help would be great. I am a teacher and trying to learn php for use in school.
Thanks
File Upload - various problems
Re: File Upload - various problems
(Ew, Internet Explorer)
I usually get errors like that when code blocks aren't closed off.
Like: if(isset($_POST){ echo "Llama"; }
(You'll notice that "isset" isn't closed off)
If you want more in-depth help, post ALL of the code you have, or the problematic lines.
I usually get errors like that when code blocks aren't closed off.
Like: if(isset($_POST){ echo "Llama"; }
(You'll notice that "isset" isn't closed off)
If you want more in-depth help, post ALL of the code you have, or the problematic lines.
Re: File Upload - various problems
Thanks. However the problem i am pretty sure is not with the HTML or PHP code. I think it must be to do with settings somewhere as not working on IE or Chrome. Any help would be great if any ideas. thanks
<?php //print_r($_POST); //print_r($_FILES); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Forms</title> </head> <body> <form action="" method="post" enctype="multipart/form-data"> <p> <input type="text" name="text_input" /> </p> <p> <input type="file" name="upload"/> </p> <p> <input type="submit" value="Send"/> </p> </form> </body> </html>
Last edited by jacek on Fri Aug 03, 2012 10:23 pm, edited 1 time in total.
Reason: code tags...
Reason: code tags...
Re: File Upload - various problems
It sounds like a problem with your server Does it work with a normal form instead of a file upload one ?