Posted: Wed Jun 09, 2004 3:58 am
This is the code you just posted
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
// you'll this next line
echo <<<STOP
<script language="Javascript">
<!--
window1 = window.open('test.asp?id={$choice1}', '', 'scrollbars=yes,width=175,height=300');
window1 = window.open('test.asp?id={$choice2}', '', 'scrollbars=yes,width=175,height=300');
//-->
</script>
STOP;
// and the previous line
?>Code: Select all
<?php
// you'll this next line
echo "<html><head>";
echo("<<<STOP");
echo("<script language="Javascript">");
echo("<!--");
echo("window1 = window.open('test.asp?id={$choice1}', '', 'scrollbars=yes,width=175,height=300');");
echo("window1 = window.open('test.asp?id={$choice2}', '', 'scrollbars=yes,width=175,height=300');");
echo("//-->");
echo("</script>");
echo("STOP;");
echo "</head><body>";
// and the previous line
echo "</body></html>";
?>Code: Select all
<?php
$choice1 = 16;
$choice2 = 24;
if(empty($_GET))
{
echo <<<STOP
<html>
<head>
<title>feyd's stab</title>
<script language="Javascript"><!--
var window1 = null;
var window2 = null;
function openSaysMe()
{
window1 = window.open('$_SERVER[SCRIPT_NAME]?id=$choice1', 'window1', 'scrollbars=yes,width=250,height=500');
window2 = window.open('$_SERVER[SCRIPT_NAME]?id=$choice2', 'window2', 'scrollbars=yes,width=175,height=300');
return false;
}
function closeSaysMe()
{
if(window1 != null)
window1.close();
if(window2 != null)
window2.close();
return false;
}
//--></script>
</head>
<body>
<div align=center><table height="99%"><tr><td valign="middle"><a href="#" onclick="openSaysMe()">attempt to open two popups!</a><br /><a href="#" onclick="closeSaysMe()">attempt to close the two popups!</a></td></tr></table></div>
</body>
</html>
STOP;
}
else
{
header("Content-type: text/plain");
print_r($_GET);
}
?>Code: Select all
//Here is the javascript part inplented with php
echo("<script language="JavaScript">");
echo("function open_popup(page)");
echo("{");
echo("window.open('test2.php?id={$quarantineid}', '', 'scrollbars=yes,width=175,height=300');");
echo("return false;");
echo("}");
echo("open_popup('test2.php');");
echo("</script>");
echo "<a href="approvemail.php?id=$quarantineid" onclick="open_popup()"><font color="#131560">Approve</font></a></td>";Code: Select all
<?
global $id;
$quarid = $id;
$blah = "9";
echo("<script type="text/javascript">");
echo("if ({$blah} < 10) ");
echo("{");
echo("window.open('test2.php?id={$quarid}', '', 'scrollbars=yes,width=175,height=300');");
echo("}");
echo("else");
echo("{");
echo("document.write("Good day!")");
echo("}");
echo("</script>");
?>