0

Hi, I have stored 800 images in root/Images and store link in DB for reference along with another information. There is a search box through which I get all the info. For viewing images I used <a href=".$row['image']." target=_blank>".$row['ch']."</a> Ch value is click here to view.
Now I want that specific image in light box in same window. How its possible?
Here is my comple code.

<form action="sims_search_view2.php" method="post">

<input type="text" value="Enter Site ID" name="a" class="textfield_effect" maxlength="30" onfocus="this.value=''">
<input type="submit" style="width: 200px;
	height: 20px;
	cursor: pointer;
	border: none;
	margin-left:0px;
	background: transparent url(/images/sims_search_button.jpg) no-repeat 0 0;" value=""/>
</form>	</td>
</tr>

        </table>
<div>
  <?
  $con = mysql_connect("localhost","root","");
   if(!$con)
     {
     die('Could not connect: ' . mysql_error());
    }
   mysql_select_db("onm", $con);


 $ID=$_POST['a'];
 


$result = mysql_query("SELECT * FROM `info` WHERE code=$ID ");
 
 while($row = mysql_fetch_array($result))
  {
  


//$form=<<<POST
 echo "<table width=80% class=info align=center bgcolor=#FFFFFF >";
       echo "<tr>";
		echo "<td colspan=5  class=servHd>  Site Critical Information </td>";
			echo "<td  class=servHd>";
			echo " <form action=sims_update.php method=post>";
        	echo "<input type=hidden value=$ID name=siteid1 />";
       		echo "<input type=submit name=sub value=update />"; 
		    echo "</form>";
		    echo "</td>";

		echo "</tr>";        
				 echo  "<tr>";
                   echo  "<th >Complete SiteId</th>";
                    echo "<td >$row[0]</th>";
                    echo "<th >Alias</th>";
                    echo "<td >$row[1]</td>";
                    echo "<th >NewId</th>";
                    echo "<td >$row[3]</td>";
				  echo "</tr>";
                  echo "<tr>";
                    echo "<th >Longitude</th>";
                    echo "<td >$row[4]</th>";
                    echo "<th >Latitude</th>";
                    echo "<td >$row[5]</td>";
                    echo "<th >Region</th>";
                    echo "<td >$row[7]</td>";
				  echo "</tr>";
                  echo "<tr>";
                    echo "<th >City</th>";
                    echo "<td >$row[8]</th>";
                    echo "<th >Classification</th>";
                    echo "<td >$row[9]</td>";
                    echo "<th >Maintained By</th>";
                    echo "<td >$row[10]</td>";
				  echo "</tr>";
                 echo "<tr>";
                    echo "<th >Address</th>";
                    echo "<td colspan=3>$row[6]</th>";
					echo "<th >Image</th>";
                    echo "<td><a href=".$row['image']." target=_blank>".$row['ch']."</a></th>";
				  echo "</tr>";
				  

                 
				  
                 echo "</table>";


//POST;
//echo $form;
  }
2
Contributors
1
Reply
4
Views
7 Years
Discussion Span
Last Post by muralikalpana
0

download jscripts from these.
http://www.huddletogether.com/projects/lightbox2/

add below jscripts and css.

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

Add a rel="lightbox" attribute to any link tag to activate the lightbox. For example:

<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>

Edited by muralikalpana: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.