my project is web image Re-Ranking. I am try to get which image is selected in the html page for update the rank of image in Mysql. My code is
index.php
<?php
include './search_image.php';
$obj_image = new Image();
if(@$_POST['Submit'])
{
$obj_image->image_name=str_replace("'", "''", $_POST['txt_image_name']);
$obj_image->Insert_into_image();
$data_image=$obj_image->get_all_image_list();
$row=mysql_num_rows($data_image);
}
?>
<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Home</title>
</head>
<body bgcolor=cyan>
<script>
window.location.hash="no-back-button";
window.location.hash="Again-No-back-button";//again because google chrome don't insert first hash into history
window.onhashchange=function(){window.location.hash="no-back-button";}
</script>
<center><h1>WEB IMAGE RERANKING</H1></CENTER>
<center>
<table border=0 cellspacing=10>
<th><a href="index.php" target="right">HOME</th>
<th><a href="admin.php" target"=right">ADMIN</th>
<form method="post" enctype="multipart/form-data">
<tr>
<th width="50%">Enter Image name for search</th>
<td width="50%"><input type="text" name="txt_image_name"></input></td>
</tr>
<td width="50%"><input type="submit" name="Submit" value="Submit"></input> </td>
</tr>
</table>
</form>
</CENTER>
<?php
if($row!=0)
{
?>
<center>
<form method="post" enctype="multipart/form-data">
<table width="30%" border="0">
<?php
while($data= mysql_fetch_assoc($data_image))
{
?>
<tr>
<a href=# onclick="loadImage(String $data['image'])"> <img src="images/<?php echo $data['image']; ?>" width="400px" height="200px" ></a>
</tr>
<?php
}
?>
</table>
</form>
</center>
<?php
}
?>
<?php
echo" <script language='javascript' type='text/javascript'>
function loadImage(String a) {
alert('1 %s',a);
}
</script>"
?>
</body>
</html>
search_image.php
<?php
include 'db_connection.php' ;
class Image{
var
$image_id,
$image_name,
$image;
function Insert_into_image(){
}
function get_all_image_list(){
$query = "select *from stor_image where img_name='$this->image_name'";
$result = mysql_query($query);
return $result;
}
}
?>
when click on specific image update the rank of the image. So I need help to find image name or src for update the data in mysql database. Thank you