We often go on some websites, such as when writing an online resume, and we will find that if we select our picture, it will be immediately displayed on the current page. We often think that this kind of thing can only be realized by ajax. Today I studied a little and found that this kind of thing is not realized by ajax.
In the end, we used our basic knowledge of FORM in HTML to implement uploading. Okay, now I will write down what I know for study purposes. Of course, these are just my own study notes. If there are any mistakes, I hope colleagues can give me some pointers.
First of all, let’s make it clear that when uploading images, we still use
But how can I display the uploaded images without refreshing? Here we need to have an understanding of .
Friends who have used this tag know that it can divide your page into several parts, and each part can have its own URL, that is, several different pages can be displayed. At this point, maybe some friends already know what this is about. Yes, this principle is used to upload pictures. It looks like they are on the same page without jumping, but in fact it has already jumped, but we didn't see it. Okay, here is a simple example, I hope it will be helpful to everyone. (php+html)
The first is the index.php page, the code is as simple as follows:
The code is as follows
|
Copy code
|
||||||||
Then there is the hello.php page, which is the page where images are uploaded
|