How to achieve picture preview?
LinXY
LinXY 2019-04-03 15:33:23
0
3
1179

echo "<center>Your file has been uploaded. Upload image preview: </center><br><center><img src='$upfile'></center>"; I use this code, but the picture cannot be displayed

LinXY
LinXY

reply all(2)
沧澜猛兽

First, make sure the image has been uploaded to a file in the project, such as the Upload file.

Secondly, make sure the $upfile image path is correct.

You can print $ first upfile, for example, the print result is ./Upload/images/xx.png, and then directly <img src='./Upload/images/xx.png'>

If the picture can be displayed, then print it yourself There is a problem with the code in a certain corner. If it cannot be displayed and Tu Qian did upload it, the image path is wrong

路边的小蚂蚁i

What is the variable value in the address in the picture tag? If you copy the variable value directly to the browser, you can see that the picture description address correctly points to the address where the picture is saved in the server. If not, it means the address is wrong. Yes

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template