NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Enctype

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 02-05-2006, 03:45 PM THREAD STARTER               #1 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




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.
Encenta.com is offline  
Old 02-05-2006, 05:10 PM   #2 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,552
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
I'm not sure it has anything to do but you should normally use double quotes in your HTML instead of singles:
PHP Code:
<form method="get" action="submit.php" enctype="multipart/form-data">
????: NamePros.com http://www.namepros.com/programming/164824-enctype.html
Are you able to make POST request on that directory using other pages than this one ?

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
sdsinc is offline  
Old 02-05-2006, 05:15 PM THREAD STARTER               #3 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




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
Encenta.com is offline  
Old 02-05-2006, 07:05 PM   #4 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,552
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
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
sdsinc is offline  
Old 02-06-2006, 11:43 AM THREAD STARTER               #5 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




Thanks for the advice. Problem exists with IE6 too
__________________
Encenta - Amazon Associates CMS
Encenta.com is offline  
Old 02-09-2006, 10:15 AM THREAD STARTER               #6 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




Also, is there a way of renaming files with a unique name before they are uploaded?
__________________
Encenta - Amazon Associates CMS
Encenta.com is offline  
Old 02-09-2006, 11:05 AM   #7 (permalink)
Professional Monkey
 
Amnezia's Avatar
Join Date: Jul 2005
Location: Escaped from the zoo
Posts: 907
Amnezia has a spectacular aura aboutAmnezia has a spectacular aura about
 


Cancer Survivorship Save a Life
Originally Posted by miseria
Also, is there a way of renaming files with a unique name before they are uploaded?
just change the file name variable in $target_path (line 5)

i would change your form method to "post" rather than "get"
__________________
Webmaster Words
Amnezia is offline  
Old 02-09-2006, 11:23 AM THREAD STARTER               #8 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




Yeah, that's the old script. The new one works but once again, other POST variables are empty.
__________________
Encenta - Amazon Associates CMS
Encenta.com is offline  
Old 02-09-2006, 02:53 PM   #9 (permalink)
Professional Monkey
 
Amnezia's Avatar
Join Date: Jul 2005
Location: Escaped from the zoo
Posts: 907
Amnezia has a spectacular aura aboutAmnezia has a spectacular aura about
 


Cancer Survivorship Save a Life
use $_REQUEST[variablename] instead of $_POST
__________________
Webmaster Words
Amnezia is offline  
Old 02-09-2006, 03:15 PM THREAD STARTER               #10 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




Thanks but still same problem
__________________
Encenta - Amazon Associates CMS
Encenta.com is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:24 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger