I have uploaded multiple images and path of all the images have been stored together.
Using explode
I have separated them and now I wish to echo them in a c
There could be a few problems here...
1. explode()
First, your explode()
may not work if your $row1["offimage"]
string doesn't have asterisks *
between the file names. In a reply comment to the OP you've given us an example of the contents of $row1["offimage"]
, which does NOT separate each PNG file by an asterisk *
:
@lolka_bolka i get this outout, uploads/c376437e2a45598b2f4d89eae4f191e8.pnguploads/c376437e2a45598b2f4d89eae4f191e8.png8069756be5095978123ae51fadbffe3b.pnguploads/c376437e2a45598b2f4d89eae4f191e8.png8069756be5095978123ae51fadbffe3b.png04aaa414c21dc057bc594b896124068e.png
– user3732711 Dec 16 '14 at 12:24
For your script to work as you've written it, we would expect to see, for example, your $row1["offimage"]
string looking like this, with an asterisk *
separating each PNG file name (with it's directory path):
uploads/c376437e2a45598b2f4d89eae4f191e8.png*uploads/c376437e2a45598b2f4d89eae4f191e8.png*8069756be5095978123ae51fadbffe3b.png
2. DIV class 'item'
As "Dan Soap" & "Rohit the developer" have answered here, for carousel to work, you need to make sure each image is wrapped in its own item
class.
Your code above has And don't forget, the 3. JavaScript You haven't included any JavaScript for us to look at... without calling the Hopefully one / some / all of these can help get your carousel up and running! :)echo"
while
loop.
echo"
foreach
loop - so that each image in the carousel is wrapped with the item
class.
item
or image you wish to have shown first (on load) should have active
class too, as well as the item
class, as such: carousel()
function, nothing will happen, only one (static) image will show. You may need something like this: