| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | Enctype Hey. I'm writing a PHP upload file. However, when I add .. enctype='multipart/form-data' .. to the form tag, none of the $_POST variables work. I think this is a common problem but how do I get around this? Thanks Solved this by using GET instead of POST. But file uploads are still no worky http://www.ewno.com/submit.phps http://www.ewno.com/fileupload.phps help is very much appreciated
__________________ Encenta - Amazon Associates CMS
Last edited by Encenta.com; 02-05-2006 at 04:04 PM.
|
| |
| | #2 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,552
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I'm not sure it has anything to do but you should normally use double quotes in your HTML instead of singles: PHP Code: Also another remark: you should not automatically do addslashes to your form fields as it may depend on your server configuration. Your scripts should check magic_quotes status and behave accordingly. Otherwise porting your scripts to another host will be a nightmare (you will have to rewrite the code).
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | THREAD STARTER #3 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | Thanks for taking a look. All the other scripts work perfectly and so did this one until adding the enctype attribute.
__________________ Encenta - Amazon Associates CMS |
| |
| | #4 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,552
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Could it be a browser issue ? http://bugs.php.net/bug.php?id=22612 Give it a try with another browser.
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | THREAD STARTER #5 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | Thanks for the advice. Problem exists with IE6 too
__________________ Encenta - Amazon Associates CMS |
| |
| | THREAD STARTER #6 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | Also, is there a way of renaming files with a unique name before they are uploaded?
__________________ Encenta - Amazon Associates CMS |
| |
| | #7 (permalink) | ||||
| Professional Monkey Join Date: Jul 2005 Location: Escaped from the zoo
Posts: 907
![]() ![]() |
i would change your form method to "post" rather than "get"
__________________ Webmaster Words | ||||
| |
| | THREAD STARTER #8 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | Yeah, that's the old script. The new one works but once again, other POST variables are empty.
__________________ Encenta - Amazon Associates CMS |
| |
| | #9 (permalink) |
| Professional Monkey Join Date: Jul 2005 Location: Escaped from the zoo
Posts: 907
![]() ![]() | use $_REQUEST[variablename] instead of $_POST
__________________ Webmaster Words |
| |
| | THREAD STARTER #10 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | Thanks but still same problem
__________________ Encenta - Amazon Associates CMS |
| |