Hi all, I'll hope you help me on this, cause I'm getting crazy!
I got a script that searchs in database the string that is giving as argument, after the string is searched in DB, it gives some results formated like this example.
($string=1987)
Code |Artist |Tecnic |Year_painted |Dimension |State Image
001 |Johnny |Oil |1987 |345X23cm. |Good |View_Image
134 |Freddy |Pencil| 1987| 345X45cm.| Bad| View_Image
right now the script is working perfect, but where says "View_Image" I'll like to link it to a POPWINDOW, where you can see the respective search image.
Now take a look of the script and maybe one of you could help me to get it done.
<?
require("../aut_verifica.inc.php");
$nivel_acceso=10; // Nivel de acceso para esta página.
if ($nivel_acceso <= $_SESSION['usuario_nivel']){
header ("Location: $redir?error_login=5");
exit;
}
if (!$string) {
header('location: ./index.php');
}
include('search.inc.php');
<?
$con= @mysql_connect("$host","$huser","$hpass") or die ("Cannot connect to MySql.");
$db = @mysql_select_db($dbn,$con) or die ("Cannot select the $dbn database.<br>Please check your details in the config.php file and try again");
$stmt=mysql_query("select * from $tb2 where $field_name like '%$string%' ");
?>
<html>
<head>
<title>- Search</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="85%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td><b>Inventario></td>
<td>Artista</td>
<td>Tecnica</td>
<td>Anno Dipinto</td>
<td>Dimensione</td>
<td>Stato Conservazione</td>
<td>Image</b></td>
</tr>
<?
while ($resultados =mysql_fetch_array($stmt)) {
$inventario = $resultados[codenum];
$artista = $resultados[artist];
$tecnica = $resultados[tecnica];
$yearpainted= $resultados[yearpainted];
$dimension = $resultados[dimension];
$conserva = $resultados[conserva];
$picture = $resultados[picture]; //The path to de image is: ./pimg/image.jpg
$trimmed= trim($picture, "./");
echo "<tr>
<td>$inventario</td>
<td>$artista </td>
<td>$tecnica </td>
<td>$yearpainted </td>
<td>$dimension </td>
<td>$conserva</td>
<td><a href=\"#\" onclick=\"java script:window.open('view_image.php?$trimmed', 'Image', 'directories=0, height=320, location=3, resizable=1, scrollbars=1, toolbar=0, width=345'); return false;\">View Picture</a></td>
</tr>";
}
?>
</table>
</body>
</html>
[code=php]
How do I make that the image shows in the new popWindow?
Thank you very much!