Php image downloading image not displayed

Source: Internet
Author: User
Php image uploading: this is the upload code if ($ _ POST [sub]) {& nbsp; $ myfile =$ _ FILES [myfile]; // Obtain the uploaded data first; & nbsp; $ name = $ myfile [name]; // Obtain the file name & nbsp; $ size = $ myfile [size]; // get the file size & do not display the php image uploaded
This is the upload code
If ($ _ POST [sub]) {
$ Myfile = $ _ FILES [myfile]; // Obtain the uploaded data first;
$ Name = $ myfile [name]; // Obtain the file name.
$ Size = $ myfile [size]; // get the file size
$ Tmp = $ myfile [tmp_name]; // get the temporary file path
$ Arr = explode (".", $ name );
$ Str = strtolower ($ arr [count ($ arr)-1]); // Get the suffix
$ NewName = date ("YmdHis"). ".". $ str;
$ Picurl = "uploadfile/". $ newName; // path to be saved in the database
Move_uploaded_file ($ _ FILES ["file"] ["tmp_name"], "../uploadfile/". $ _ FILES ["file"] ["name"]);
Mysql_query ("insert into history (title, time, picurl, content, introduct) values ('$ _ POST [title]', '$ _ POST [time]', '$ picurl',' $ _ POST [content] ',' $ _ POST [introduct] ') ");
?>
This is the display code
"Width =" 100 "height =" 100 "/>
Images are not displayed after being uploaded to the server.
------ Solution --------------------
$ Myfile = $ _ FILES [myfile]; // Obtain the uploaded data first;
Move_uploaded_file ($ _ FILES ["file"] ["tmp_name"], "../uploadfile/". $ _ FILES ["file"] ["name"]);

What is the name?
------ Solution --------------------
No value for $ row [picurl]
------ Solution --------------------
Reference:
No value for $ row [picurl]

++
------ Solution --------------------
You do not need to delete it. for example, you only need to change the file in the following sentence to myfile.
If you delete the above sentence, you have to modify line 3.4.5 in your code.
------ Solution --------------------
Are you sure you want:
1. Are you sure the image has been uploaded successfully? Can I find the uploaded image in the folder?
2. have the image information been saved to the database?
3. if neither of the above two points is correct, are the available image address paths on the server compliant with the server's url rules after uploading to the server?

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.