Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 20th, 2004, 09:12 PM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default New Window in PHP JavaScript

I want to open a new window from a javascript URL in a PHP page and pass the window some parameters. Anybody have some sample code for this.

I have tried the following but it is giving "error on page"?

from PHP page:
?>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function open_window("SimpleTest.htm","first","resizable=no ",height=200",width=200") {
   var NEW_WIN = null;
   NEW_WIN = open();

}
-->
</SCRIPT>
<?php

and call it with HREF as follows:
echo "<A HREF=\"javascript:open_window();\">Test </A>\n";

Thanks

 
Old August 20th, 2004, 10:15 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You have some serious syntax issues.

I think you want to do this:

<a href='javascript:window.open("SimpleTest.htm","fir st","resizeable=no,height=200,width=200")'>test</a>

Eh?

Snib

<><
 
Old August 21st, 2004, 05:33 PM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help ..it works now ..





Similar Threads
Thread Thread Starter Forum Replies Last Post
New window not being open by javascript akhilesh_g Classic ASP Professional 1 September 14th, 2007 04:13 AM
Javascript Window Closer apartmentsabroad Javascript How-To 3 September 19th, 2006 07:15 AM
on window unload event in javascript. babu17 Classic ASP Basics 1 April 15th, 2006 05:48 AM
Popup window from javascript arnabghosh Javascript How-To 1 March 2nd, 2006 10:17 AM
Popup window from Javascript arnabghosh Javascript 3 March 1st, 2006 01:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.