Jump to content


Photo

Value of $_FILES


  • Please log in to reply
2 replies to this topic

#1 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 08 September 2006 - 07:15 PM

Hey

Something we discussed ages ago, and never got a solution (might have been another forum)

As an example
I have a form
<form method='post' action='' enctype='multipart/form-data'>
<input type='files' name='ufile' /><br />
<input type='text' name='file_name' value='".$_POST["file_name"]."' /><br />
<input type='submit' value='Upload' />
</form>

As you can see, I am using $_POST to get the value of the form, so when validating, if they miss a field, they dont have to complete the whole form again

Certain things on my form I dont want a value for
Passwords
Agree to terms and conditions

BUT
I would like a value for the image
Does anyone know how to do this

Last time we suggested that I store the details I need, and have a link, saying change image click here
then parse the values over again
BUT
I want to know can I do something like
<input type='file' name='ufile' value='".$_FILES["ufile"]["name"]."' />
which dont work, but I hope u understand
Tell me the problem, I will try tell you the solution

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 08 September 2006 - 11:01 PM

No . Value property of a file input field is read-only. You can only set it via Browse button
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 09 September 2006 - 01:38 AM

Is there anyway to have the "Find File" pop up keep the file name?
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users