I know this isn't a php question, but I was hoping someone out there might see what's causing my problem here. (At least I'm using PHP too!) For some reason, after this function executes, the main window reloads itself - which I don't want.
<SCRIPT Language='JavaScript'>
<!-- JavaScript Follows
var content
function winopen (content) {
msg=open("","NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=400,height=260,screenX=300,screenY=300,top=300,left=300");
msg.document.write("<HEAD><TITLE>Welcome.</TITLE></HEAD>");
msg.document.write("<CENTER><h1><B>This is your new window.</B></h1></CENTER>");
msg.document.write(content);
msg.document.write("<FORM><CENTER><INPUT TYPE='BUTTON' VALUE='Close Window' onClick='window.close()'></CENTER></FORM>");
}
//JavaScript Ends -->
</SCRIPT>
and then in the page, I have this to call the function:
$content="<CENTER>THIS WORKS!<BR>$city</CENTER>";
print ("<FORM><INPUT ONCLICK=\"javascript:winopen('$content')\" TYPE='image' SRC=\"images/moreinfo.gif\" VALUE='more info'></FORM>\n");