Jump to content

Javascript and php


Craig Hopson

Recommended Posts

hi i'm stuck again i want a simple image slider but the problem is this

var finalslide=''leftrightslide[0]='<img src="dynamicbook1.gif" border=1></a>'leftrightslide[1]='<img src="dynamicbook2.gif" border=1></a>'leftrightslide[2]='<img src="dynamicbook3.gif" border=1></a>'leftrightslide[3]='<img src="dynamicbook4.gif" border=1></a>'leftrightslide[4]='<img src="dynamicbook5.gif" border=1></a>'

as you can see i need to tell it what images to display problem is my images come from this

$result = mysql_query("SELECT * FROM files ORDER BY RAND() LIMIT 20");while($row = mysql_fetch_array($result))  {$img = 'uploads/'.$row['album'].'/'.$row['filename'];echo '<span style="padding:10px;"><img src="'.$img.'" width="50px" height="50px" style="border:1px solid black;"/></span>';}

so how can i integrate them?

Link to comment
Share on other sites

You could make an AJAX request to a PHP script to get the content or have PHP load the page and echo the array of images.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...