www.webdeveloper.com
Results 1 to 5 of 5

Thread: javascript php help

  1. #1
    Join Date
    Mar 2010
    Posts
    60

    javascript php help

    Hello to all,

    I'm building a site using php and mysql and I'm stuck on a last piece of functionality. I'm allowing users to upload pictures to a mysql table which will then be displayed on my site. I have no problem uploading or displaying the images.

    The problem lies when I want the user to see a larger version of the pictures. I cant figure out a way so that when the user clicks on one of the smaller images a pop up window is opened with the large image and next and previous buttons.

    Any help would be appreciated
    here is my code
    Code:
        $result = mysql_query("SELECT * FROM photo WHERE dogname ='$name'");
    			$i=0;
    			$num=mysql_numrows($result);
    			
    			//echo "<table>";
    		   	
    		   		while($r=mysql_fetch_array($result))
    			{	
    			
    				$dogname=$r["dogname"];
    				$caption=$r["caption"];
    				$dogphoto=$r["dogphoto"];
    				$id=$r["id"];
    			
    			if($i==0){
    				echo"<tr>";
    			}	
    				
    			echo "<td><img src='$dogphoto' width='200' height='150'></td>";
    			$i++;
    			if($i==3){
    			echo "</tr>";
    			$i=0;
    			}
    			
    		}
    So how do i make an image pop up when clicked?
    After some research I'm sure I have to use javascript. The problem is im not very familiar with that language.
    Thanks in advance!

  2. #2
    Join Date
    Mar 2010
    Posts
    60
    Anyone please?

  3. #3
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    A simple dhtml popup or a lightbox?

  4. #4
    Join Date
    Mar 2010
    Posts
    60
    Quote Originally Posted by Fang View Post
    A simple dhtml popup or a lightbox?
    Just a simple pop up box, i.e just click the picture and the pop up opens with the full size image

  5. #5
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Where will the larger image appear? Near the smaller image or a specific location?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles