why doesn't this work? javascript making new pop-up window...<

liunx

Guest
Parent window code:
=============

<ul>
<li><a href=http://www.htmlforums.com/archive/index.php/"#" onClick="window.open('webdbe_subwin.php?help=about','About webdbe','statusbar,menubar,height=400,width=300')">About webdbe</a></li>
<li><a href=http://www.htmlforums.com/archive/index.php/"#" onClick="window.open('webdbe_subwin.php?help=schema','On Schema','statusbar,menubar,height=400,width=300')">On Schema</a></li>
<li><a href=http://www.htmlforums.com/archive/index.php/"#" onClick="window.open('webdbe_subwin.php?help=table&mytable=<?php echo $mytable ; ?>','On <?php echo $mytable ; ?>','statusbar,menubar,height=400,width=300')">On <?php echo $mytable ; ?></a></li>
</ul>


In webdbe_subwin.php
==============

<?php
// PHP Code here
$help = $_GET['help'] ;
$mytable = $_GET['mytable'] ;
?>

<html>
<head>
<title><?php echo $help ; ?></title>
</head>
<body>
<?php
echo $help;
echo $mytable;

if ( $help == "about" ) {
echo "<h1>About webdbe</h1>";
} elseif( $help == "schema" ) {
echo "<h1>On Schema</h1>";
} elseif( $help == "table" {
echo "<h1>On $mytable</h1>";
} else {
echo "<p>You did not define what you wanted to see!</p>";
exit ;
}
?>
</body>
</html>for clarification, the pop-up window function (javascript part) works fine.

the problem is that the GET variables are not passed ( or is that parsed :P ) correctly...

thx.So I am assuming that this is because in calling this page it does not get parsed by the PHP engine. Would I be able to get around this by forcing an onLoad() function in the <body> tag?only if the parent is php itself. but that should work.only if the parent is php itself.

For the onLoad event? The parent is a PHP file...

but that should work.

You mean what I first posted? Nope - no success there...I use varaibles in my script that load in a popup so I know it works. is this related to the other thread? it might be that your box is not running php correctly if you can get anything to run that should.Originally posted by scoutt
I use varaibles in my script that load in a popup so I know it works.

Got an example I can use? - or is it just like what I tried?


is this related to the other thread?


same project different page :)


it might be that your box is not running php correctly if you can get anything to run that should.

All the rest of the PHP works fine - I will PM you the URL...pretty close to the same code

but you also didn't finish the javascript part


'statusbar,menubar

you need to give those avalue

'statusbar=0,menubar=0

or it might error out. or 1 if you want it to showFigured it out! Stupid syntax error by me - see in red below - I forgot to close the paratheses...

:mad:

In webdbe_subwin.php
==============

<?php
// PHP Code here
$help = $_GET['help'] ;
$mytable = $_GET['mytable'] ;
?>

<html>
<head>
<title><?php echo $help ; ?></title>
</head>
<body>
<?php
echo $help;
echo $mytable;

if ( $help == "about" ) {
echo "<h1>About webdbe</h1>";
} elseif( $help == "schema" ) {
echo "<h1>On Schema</h1>";
} elseif( $help == "table" {
echo "<h1>On $mytable</h1>";
} else {
echo "<p>You did not define what you wanted to see!</p>";
exit ;
}
?>
</body>
</html>ahhh yup, I even missed that one.
 
Back
Top