Problems with PHP form submission

Source: Internet
Author: User
Tags php form
Ladies and gentlemen, there is a problem, I have a data table, the data table has n multiple fields, I built a form in PHP, the type of the form has the text and file type, if the content is submitted to the database? and displays the submitted value in the page, how the file type displays the hyperlink address of the uploaded file in the page, that is, I can see the uploaded file when I click on the address. Thank you!


Reply to discussion (solution)

Like the address you uploaded was/upload/x.x.
Then your upload hyperlink address is http://localhost/upload/x.x.
That is your domain + upload path

Picture Word Gencun The address of the image after uploading it.

$upload _file=$_files[' upload_file ' [' tmp_name '];  $upload _file_name=$_files[' upload_file ' [' name '];  Copy the file to the specified directory  if (!move_uploaded_file ($upload _file, "upload/". $upload _file_name)) {  echo "failed to copy file";  Exit;  }  
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.