Home > Backend Development > PHP Tutorial > php表单提交的问题

php表单提交的问题

WBOY
Release: 2016-06-23 14:38:44
Original
987 people have browsed it

各位大神,小弟有一问题,我有一个数据表,该数据表有n多字段,我在php中建了一个表单,表单中的类型有text和file类型,如果同时提交内容到数据库?并且在页面中显示提交的值,file类型如何显示在页面中显示上传文件的超链接地址,就是我一点击该地址就能查看到上传的文件。谢谢!


回复讨论(解决方案)

比如你上传的地址是   /upload/x.x
那你的上传超链接地址就是  http://localhost/upload/x.x
也就是你的域名 + 上传路径

图片字段存图片上传后的地址吧。

$upload_file=$_FILES['upload_file']['tmp_name'];  $upload_file_name=$_FILES['upload_file']['name'];  //复制文件到指定目录  if (!move_uploaded_file($upload_file,"upload/".$upload_file_name)) {  echo "复制文件失败";  exit;  }  
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template