Does anyone know how to extract the name from a file field so I can insert it into my database???
<form action="" method="post" enctype="multipart/form-data" name="insert" id="insert">
<br>
Image:
<input name="file" type="file" id="file">
<br><br>
<input name="submit" type="submit" id="submit" value="Add">
<INPUT NAME="add" TYPE=Hidden Value="yes" Size="">
<INPUT NAME="auto" TYPE=Hidden Value="0000" Size="">
</form>
Name from file field
Moderator: General Moderators
- skylavelle
- Forum Newbie
- Posts: 18
- Joined: Sun May 04, 2003 11:33 pm
- Location: Brisbane, Australia
Name from file field
Last edited by skylavelle on Mon May 19, 2003 5:12 pm, edited 1 time in total.
- skylavelle
- Forum Newbie
- Posts: 18
- Joined: Sun May 04, 2003 11:33 pm
- Location: Brisbane, Australia
take a look at the members of each entry in $_FILES
http://www.php.net/manual/en/features.f ... hp#AEN5966
http://www.php.net/manual/en/features.f ... hp#AEN5966
- skylavelle
- Forum Newbie
- Posts: 18
- Joined: Sun May 04, 2003 11:33 pm
- Location: Brisbane, Australia
I have created an image uploader and an insertion for my database on one php.
It uploads the image fine and insert the rest of the textual fields, which above are not mentioned, into the database.
However, I want to know if there is a way of taking the name from the file field and placing in front of the path. At the moment I have the path and are forced to have another text field present where the user must enter the file name. These to are merged and the file and its path is place on the database.
I want to be able to remove this last text field and in order to do so I have to take the name from the file field when you choose what file you want to upload.
Any ideas?
It uploads the image fine and insert the rest of the textual fields, which above are not mentioned, into the database.
However, I want to know if there is a way of taking the name from the file field and placing in front of the path. At the moment I have the path and are forced to have another text field present where the user must enter the file name. These to are merged and the file and its path is place on the database.
I want to be able to remove this last text field and in order to do so I have to take the name from the file field when you choose what file you want to upload.
Any ideas?