[Javascript] Re: Javascript digest, Vol 1 #817 - 7 msgs

Lewis Shadoff lshadoff at brazosport.cc.tx.us
Mon Nov 25 10:37:06 CST 2002


You can use the values stored in php variables in constructing a web 
page.  Suppose the following php variables have been defined and their 
values assigned using php:

$contentURL, $windowName, $windowWidth, $windowHeight

You can construct the JavaScript window open statement inside the <script> 
tags like this:

<?php
printf ( "window.open(%s,%s,%s,%s);", $contentURL, $windowName, 
$windowWidth, $windowHeight );
?>

or alternatively:

<?php
echo "window.open($contentURL,$windowName,$windowWidth,$windowHeight);";
?>



The definitive php manual is at:

<http://www.php.net/>

Lew


At 08:57 AM 11/25/2002, Patricia Calatayud wrote:
>How can I open a new window from a php/html document and
>get that the terms in the new window are generated dynamically by
>php?
>
>I have used the following, but it doesn=B4t work.
>
>In Normal php document:
><head>
><script><!--
>var newWindow =3D null;
>
>function openWindow(contentURL,windowName,windowWidth,windowHeight) {
>widthHeight =3D 'height=3D' + windowHeight + ',width=3D' + windowWidth;
>newWindow =3D window.open(contentURL,windowName,widthHeight);
>newWindow.focus()
>}

Lewis A. Shadoff, Ph.D.
Brazosport College
Lake Jackson, TX





More information about the Javascript mailing list