开发者

random quote generator in php using mysql

开发者 https://www.devze.com 2022-12-27 03:22 出处:网络
i coded a random quote generator in php using mysql but also jquery. however when i try to integrate it with开发者_运维技巧 facebook, since i opted to use fbml, i could not use jquery.

i coded a random quote generator in php using mysql but also jquery. however when i try to integrate it with开发者_运维技巧 facebook, since i opted to use fbml, i could not use jquery.

how do i get the quote to display randomly in php at say, 30 mins, without using jquery or javascript?


You could use your jquery-made quotes solution in facebook fbml app using the <fb:iframe> tag.


Write a script that grabs all quotes from the database, and use rand() to pick one. Then save the quote to a file as you want it to appear. Each time you run the script it should overwrite the file, and your output will just include the file to display the quote.

Then just run your quote chooser as a cron job set to every 30 mins.

0

精彩评论

暂无评论...
验证码 换一张
取 消