Any JavaScript/ DHTML can essentially have its data dynamically generated from a database. It's just a matter of isolating the portions of the script that contains the data, and store it on the server side. In this case, the data is the following:
messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");
messages[1] = new Array('duck2.gif','Here is a duck on a light blue background.',"#DDECFF");
messages[2] = new Array('test.gif','Test description','black','white');
So I you'd want to store the image paths and text descriptions in your db, and dynamically output this portion of the JavaScript (the messages[] array), drawing the image path/ messages from the db. Using PHP, you may end up with something like:
Code:
echo "messages[0]=new Array('" . imagedata . ", '" . description . ", '" . bgcolor +"')';
"
"
Bookmarks