Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2009
    Posts
    184
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Using PHP with javascript slideshow

    I'm trying to set up a Javascript slideshow but with images that are pulled from a mYSQL database using PHP.

    For example:

    PHP Code:
    if (!empty($row['pic1']))
    {
    echo 
    '<td><a href="images/carpictures/' $title16 '"><img src="images/carpictures/' $title16 '"  width="140" height="93"></a></td>';

    - and so on, with a statement testing to see if an image exists in that field. If it does, it gets added to the page with all the images displayed as thumbnails.

    What I want is to have the images bring up their larger version when hovered over, and launch a slideshow with an autoplay feature as well as the usual back / next / play / stop controls etc.

    However all the slideshows I've seen (Javascript based) have the image names assigned manually to individual variables in the page header.

    The problem being that my images are being generated by the PHP call to the database.

    Anyone know how I can get a Javascript slideshow working within this context- or know of one which actually does work with PHP?

    (I was using Lightbox, which is great, except that the client doesn't like it so I can't use it...)

  • #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    Quote Originally Posted by galahad3 View Post
    However all the slideshows I've seen (Javascript based) have the image names assigned manually to individual variables in the page header. The problem being that my images are being generated by the PHP call to the database. Anyone know how I can get a Javascript slideshow working within this context- or know of one which actually does work with PHP?
    PHP can output Javascript. Can you post a link to the Javascript slide show you are thinking of using?

    PHP Code:
    if (!empty($row['pic1']))
    {
    // html and javascript


    ---------
    Leonard Whistler


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •