we have a ajax, php,mysql search script that gets records from a mysql dbase and list them in a table. the user can then select any of the found items and have a detail page returned.
we have a typical href script working to do this however what we need is to open the found item detail page(s) in a new browser window using the window.open() function.
We have this working, however selecting the window.open() function for any of the found items always calls the last record found when the query ran.
Below is the script producing this result, please assist so that we can get the window.open() to get the correct found item record.
.....mysql connects and queries database..............
while($row=mysql_fetch_arr
ay($sql))
{
?>
<font size=2 color="#000000" face="Arial">
<div align="left"><table width="100%" border="1" cellpadding="0" cellspacing="0" bgcolor="#ffcc99">
<td width="95"><font size=2 color="#000000" face="Arial">
<div>Issue Date:</div>
</font>
</td>
<?php
$_SESSION['mainproduct']=$
row['brand
_wwb'];
$_SESSION['prod_selected_p
kid']=$row
['prodwwb_
pkid'];
=====this script calls detail page and sends correct id for the appropriate found item
$prodsec1= "
http://192.x.x.x/url_path/".$row['brand_wwb']."/".$
row['type_
wwb']."/".
$call_deta
il_page."?
prodwwb_pk
id=".$row[
'prodwwb_p
kid'].'">'
;
?>
<script type="text/javascript">
function open_win_article()
{
window.showModelessDialog(
'<?php echo $prodsec1; ?>','<?php echo $prodsec1; ?>',"dialogHeight: 725px; dialogWidth: 850px; dialogTop: 150px; dialogright: 450px; edge: Raised; center: yes; help: No; scroll: yes; status: no;")
}
</script>
<input type="button" value="Review This Item" onclick="open_win_article(
)" />
<td width="434"><?php echo $row['model_wwb']; ?> <br />
</td>
</tr>
=========
As stated with the above script we always get the last found item record from the query, and to restate, a typival href() script always works to get the correct found item as selected from the found item display table.
We can provide more info if need, we are in a bit of a hurry so any fast help will be appreciated.
Thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
This award recognizes an author who contributes the highest volume of original works or content. Recipients of this award produce extremely valuable content that prioritizes accuracy, relevancy, and professionalism.