Hello All,
I have look through these forus for a possible answer, but all other repies show the javascript new window call outside a php script. I need to run the open window command from withn a php script because the new window name is taken from an ADO connection that the php script runs.
So far, everything looks ok but when clicking on the new window link, the page opens up with it's self and now a new predefinded window.
The javascript function sits in the head section of the htm page and is:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// End -->
</script>
Just using a normal html page with the javascript link of
<a href="webcam.htm" onclick="NewWindow(this.href,'webcam','340','320','no');return false;">Pigmaster Link</a>
works fine. i.e. it open a new window as defined in the javascript called webcam.
Now if I place these php script into a page (PhotoUrl come from an ADO connection made earlier with the php scritp. So when the link is place with the html, all looks fine but open up in it's self.
<?
$Photo=$rs->Fields["PhotoUrl"]->value;
if ($Photo == "X") {
echo "<td>No</td>";
} else {
echo "<td><a href='".$rs->Fields["PhotoUrl"]->value."' onclick='NewWindow(this.href,'webcam','340','320','no');return false;'</a>yes</td>";
}
echo "</tr>";
}
?>
So, where am I going wrong.
To see it (hopefully) going wrong, goto www.pigmaster.co.uk/flightlog.htm and click on the "yes" photo link
Thanks