1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > php图片怎么存入指定文件夹_在PHP中如何把图片存入数据库和文件夹里

php图片怎么存入指定文件夹_在PHP中如何把图片存入数据库和文件夹里

时间:2020-10-02 22:53:33

相关推荐

php图片怎么存入指定文件夹_在PHP中如何把图片存入数据库和文件夹里

$file_dir = "your dir"; //用你的上传目录代替

$tmep_cfile1 = "goods_file".$i;

$temp_cf = "goods_file".$i;

$temp_cn = "goods_file".$i."_name";

$temp_cs = "goods_file".$i."_size";

$temp_ct = "goods_file".$i."_type";

$temp_cx = "goods_file".$i."_text";

$temp_cd = "goods_file".$i."_del";

if($_FILES[$tmep_cfile1]) {

$$temp_cf = $_FILES[$tmep_cfile1][tmp_name];

$$temp_cn = $_FILES[$tmep_cfile1][name];

$$temp_cs = $_FILES[$tmep_cfile1][size];

$$temp_ct = $_FILES[$tmep_cfile1][type];

}

if($$temp_cs > 0) {

if($$temp_cx) {

file_unlink(".{$$temp_cx}");

}

$$temp_cf = upload_file($$temp_cf, $$temp_cn, $$temp_cs, $file_dir, $g_file_okext, $g_max_file_size);

}

elseif($$temp_cd) {

if($$temp_cx) {

file_unlink(".{$$temp_cx}");

}

$$temp_cx = "";

}

写入数据库就是把那些文件名,路径,大小,类型之类的写入吧。没什么可说的了。

作者: 大宝

发布时间: -03-02

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。