note 70090 added to features.file-upload
| From: | timi80 at hotmail dot com | Date: | Mon, 02 Oct 2006 21:41:41 +0000 |
| Subject: | note 70090 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117967@lists.php.net to get a copy of this message | ||
i have done whatever had told and could upload the files.. but my problem is i have to put the file
names on mysql to recall them when the page will be shown...
my codes:
<?php
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] ==
"form1")) {
$data = addslashes(fread(fopen($pictures, "r"),filesize($pictures)));
$insertSQL = sprintf("INSERT INTO info (category, parag_01_00, parag_01_01, .... aciklama,
dosya_adi, boyut,
resimdata, dosyatip) VALUES (%s, %s, .... %
s, '$pictures_name','$pictures_name','$pictures_size',
'$pictures_data','$pictures_type')",
//bu kisimlar anlasilacagi gibi form bilgilerini aliyor
GetSQLValueString($_POST['category'], "text"),
GetSQLValueString($_POST['parag_01_00'], "text"),
GetSQLValueString($_POST['parag_01_01'], "text"),
....
...
...
GetSQLValueString($_POST['pictures'], "text"));
mysql_select_db($database_tf, $tf);
$Result1 = mysql_query($insertSQL, $tf) or die(mysql_error());
}
foreach ($_FILES["pictures"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
$name = $_FILES["pictures"]["name"][$key];
move_uploaded_file($tmp_name, "data/$name");
}
}
?>
///////////////////////////////////////
<form action="<?php echo $editFormAction; ?>" method="POST"
enctype="multipart/form-data" name="form1">
..
<td>Picture</td>
<td><input type="file" name="pictures[]" />
<input type="file" name="pictures[]" />
<input type="file" name="pictures[]" />
<input type="submit" value="Send" />
</td>
</tr>
<input type="submit" name="Submit" value="SUBMIT">
</div></td></tr>
how can i add the file names of uploaded files to use them in the page=???
----
Server IP: 66.163.161.117
Probable Submitter: 85.98.219.236
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- https://master.php.net/note/edit/70090
Del: integrated -- https://master.php.net/note/delete/70090/integrated
Del: useless -- https://master.php.net/note/delete/70090/useless
Del: bad code -- https://master.php.net/note/delete/70090/bad+code
Del: spam -- https://master.php.net/note/delete/70090/spam
Del: non-english -- https://master.php.net/note/delete/70090/non-english
Del: in docs -- https://master.php.net/note/delete/70090/in+docs
Del: other reasons-- https://master.php.net/note/delete/70090
Reject -- https://master.php.net/note/reject/70090
Search -- https://master.php.net/manage/user-notes.php