Home  >  Article  >  Web Front-end  >  Use javascript+php to randomly display images

Use javascript+php to randomly display images

黄舟
黄舟Original
2016-12-19 17:26:421231browse

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 )!

Statement:
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