sticky forms with upload

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

sticky forms with upload

Post by pleigh »

hi there, want to implement a sticky form on my upload form. i have this code

Code: Select all

<input name="uploaded" type="file" class="FormButton" value="<?php if(isset($_POST['uploaded']) echo  $_POST['uploaded']; ?>" />&nbsp;
<input type="submit" name="upload" value="Upload" class="FormButton" /><br>
when i run this code, it went blank whenever there's an error on the other elements. i need your help. thanks in advance.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

You can't set a value for a file input element.
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post by pleigh »

i cant implement a sticky form in file input? sorry, cant understand it right. :oops:
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

That's right. You can't. It's impossible. If web developers could set the value of a file upload element we could grab any file we wanted from user's computers. That would be a huge security problem, so consequently file elements don't let you do it.
Post Reply