Ec (2); you must use javascript to randomly display images. However, the materials (such as links) of fake films often change or are modified or added by users. What should I do? I have a solution here. Put the image information (such as name, address, Link, etc.) in a TXT file (if MYSQL is better, or not ). The PHP program is called by javascript in HTML files, and the PHP program randomly reads image data. Readrand. php (this program actually generates a javascript script ec (2); script
You will use javascript to randomly display images. However, the materials (such as links) of fake films often change or are modified or added by users. What should I do? I have a solution here.
Put the image information (such as name, address, Link, etc.) in a TXT file (if MYSQL is better, or not ). The PHP program is called by javascript in HTML files, and the PHP program randomly reads image data.
Readrand. php (this program actually generates a javascript LANGUAGE)
$ Arrayall = file ("tp.txt" when reading the content of tp.txt to the array
$ Arrays = count ($ arrayall );
If ($ arrays = 1) {// because rand (0, 0) is wrong
$ Selectrand = 0;
} Else {
Srand (double) microtime () * 1000000); // sets the Random Seed.
$ Selectrand = rand (0, $ arrays-1 );
}
$ Exstr = explode (chr (9), $ arrayall [$ selectrand]); // randomly retrieve and divide all
?>
Document. write ('"target =" new ">" width = "200" height = "50" alt =" "> ');
HTML file