Home > Web Front-end > JS Tutorial > body text

Use javascript+php to randomly display images

黄舟
Release: 2016-12-19 17:26:42
Original
1202 people have browsed it

Presumably you will use javascript to display images randomly. But what if the image information (such as a link) changes frequently, or is modified or added by the user? I have a solution here.
Put the image information (such as name, address, link, etc.) in a TXT file (MySQL is better, but it doesn’t matter). In the HTML file, Javascript calls the PHP program, and the PHP program randomly reads the image data. See the program


(You can Put scripty where you need it, and add the setTimeout() function to achieve regular refresh)

The above is the content of using javascript+php to randomly display images. For more related content, please pay attention to the PHP Chinese website (www.php.cn )!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!