By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,590 Members | 663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,590 IT Pros & Developers. It's quick & easy.

Existing file name

P: n/a
Hi

I am retrieving a fielname for a picture in PHP/MySQL and would like the
existing filename that is being retrieved from the database to be shown in a
file input. How do I do this please?

If I simply use a value statement nothing is shown even though I know the
variable holds the correct value.

The code I am using is
$picture1filename = $myrow[4] ;
echo " myrow[4] in form " . $myrow[4] . "<br>";
echo " picture1filename in form " . $picture1filename ;
echo ("<td colspan='2'><input name='picture1' type= 'file' size='80'
value= '$picture1filename'>");

The echos are just there to show that the correct value has been found.

Any help would be appreciated.
Many thanks
Derek

Jul 12 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Rik
Derek @ Blueyonder wrote:
Hi

I am retrieving a fielname for a picture in PHP/MySQL and would like
the existing filename that is being retrieved from the database to be
shown in a file input. How do I do this please?
It's a security issue, you can't set the value of the file input.
What would stop you to make it a hidden input and enter a name usually found
in an OS containing private information?

If it's a file that's on your server, just use a text-input, and act
accordingly after posting the form.

Grtz,
--
Rik Wasmus
Jul 12 '06 #2

P: n/a
>I am retrieving a fielname for a picture in PHP/MySQL and would like
the existing filename that is being retrieved from the database to be
shown in a file input. How do I do this please?

It's a security issue, you can't set the value of the file input.
What would stop you to make it a hidden input and enter a name usually
found
in an OS containing private information?

If it's a file that's on your server, just use a text-input, and act
accordingly after posting the form.

Grtz,
--
Rik Wasmus

Hi

Thank you for your reply.

I have done as you suggested and it works fine.

Many thanks
Derek
Jul 12 '06 #3

P: n/a
*** Derek @ Blueyonder escribió/wrote (Wed, 12 Jul 2006 09:32:49 GMT):
I am retrieving a fielname for a picture in PHP/MySQL and would like the
existing filename that is being retrieved from the database to be shown in a
file input. How do I do this please?
Most browsers won't allow that. There's a famous one that does but I cannot
recall which one (Konkeror maybe?).

--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Jul 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.