Jump to content


Photo

How to populate multipart form/data fields


  • Please log in to reply
2 replies to this topic

#1 kolakube

kolakube
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 08 May 2006 - 05:18 PM

Hiya all

Just started PHP, Im having problems populating a field from the data base, here goes

<input name="PHOTOONE" type="file" size="35" VALUE="<?php print "$row[PHOTOONE]"; ?>">

when i try and preview this I get nothing on the field, if i had it on type ="text" this works, but I want to create an edit page so I can populate the field with the existing field name, so if i do not want to update the info it will just post the old data field.

Maybe Im missing something..

Many thanks

#2 lead2gold

lead2gold
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 08 May 2006 - 05:25 PM

[!--quoteo(post=372325:date=May 8 2006, 01:18 PM:name=kola)--][div class=\'quotetop\']QUOTE(kola @ May 8 2006, 01:18 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hiya all

Just started PHP, Im having problems populating a field from the data base, here goes

<input name="PHOTOONE" type="file" size="35" VALUE="<?php print "$row[PHOTOONE]"; ?>">

when i try and preview this I get nothing on the field, if i had it on type ="text" this works, but I want to create an edit page so I can populate the field with the existing field name, so if i do not want to update the info it will just post the old data field.

Maybe Im missing something..

Many thanks
[/quote]

i don't think it's possible to populate type file boxes... the best thing to do in that situation is display the contents above the empty box (if any is present) and when they attempt to upload yet another file, then replace the old data on the submit.



#3 kolakube

kolakube
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 08 May 2006 - 05:32 PM

Thx for the quick response Gold, I had thought about that, but when I see scripts like 4imagegallery edit page I was think maybe there may be an easy way round this.

as again thx for the reply :-)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users