Old 15-11-2004, 08:58   #1 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
PHP upload with form validation

Got a long form with server side validation, all working loverley.

Until I add an input type="file". Due to the fact that PHP puts uploaded files in to the $_FILES array, and the value="" is ignored on most browsers.

How do I keep the $_FILES information on subsequent posts?

I need to process the upload after I've got all the form information, but didn't want to split the form down (but it looks like I may have to).
  Reply With Quote
Old 15-11-2004, 09:05   #2 (permalink)
gray
i still want paying
 
gray's Avatar
 
Join Date: Oct 2003
Location: newcastle, uk
Posts: 4,842
check for a value of $variable_name

i.e.

<input type="file" name="mypic" />

then check for $mypic_name instead of $mypic

might work
  Reply With Quote
Old 15-11-2004, 09:21   #3 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
I've got the file checking sorted, but if other information is not valid, and the user submits again, I lose the file
  Reply With Quote
Old 21-11-2004, 23:27   #4 (permalink)
twentyfour
Registered User
 
Join Date: Nov 2004
Posts: 3
Send a message via MSN to twentyfour
try enctype="multipart/form-data"
  Reply With Quote
Old 21-11-2004, 23:28   #5 (permalink)
twentyfour
Registered User
 
Join Date: Nov 2004
Posts: 3
Send a message via MSN to twentyfour
actually, I totally misread your question, ignore me.
  Reply With Quote
Reply



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

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8