vikaspa Posted August 22, 2007 Share Posted August 22, 2007 I am using following scipt for javascript slide show. I want to replace the image names with the one I read using PHP+MYSQL database (conditional SQL statement ) Please help help help me to use image names stored in PHP variable names Thanks in advance <script> <!-- //configure the paths of the images, plus corresponding target links slideshowimages("img1.gif", "img2.gif", "img3.gif") slideshowlinks("http://wsabstract.com", "http://dynamicdrive.com", "http://java-scripts.net") //configure the speed of the slideshow, in miliseconds var slideshowspeed=2000 var whichlink=0 var whichimage=0 function slideit(){ if (!document.images) return document.images.slide.src=slideimages[whichimage].src whichlink=whichimage if (whichimage<slideimages.length-1) whichimage++ else whichimage=0 setTimeout("slideit()",slideshowspeed) } slideit() //--> </script> Quote Link to comment https://forums.phpfreaks.com/topic/66120-use-iamge-name-full-path-read-from-database-in-javascript/ Share on other sites More sharing options...
vijayfreaks Posted August 22, 2007 Share Posted August 22, 2007 Hi.. yes you can do this via fetching records from db after getting records, you can echo the image name from database in javascript like following: <script> <!-- //configure the paths of the images, plus corresponding target links slideshowimages(<?php echo "'$image1'"?>,<?php echo "'$image2'"?>, <?php echo "'$image3'"?>) Is it what you want..? -Vijay Quote Link to comment https://forums.phpfreaks.com/topic/66120-use-iamge-name-full-path-read-from-database-in-javascript/#findComment-330732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.