JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 9th, 2001, 12:24 AM
alistair alistair is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 1 alistair User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question javascript window.open in PHP3 ?

The following code is in a php3 program and DOES NOT open a new (php3) window, but if it is typed into Netscape Javascript typein it DOES Work?....What's up?print "<script language=\"JavaScript\">";
print "<!-- ";
print "function openwin(option) {";
print " popupWin = window.open('http://mydomain.com/cgi-bin/something.php?q_option='+ escape(option), 'escape(option)','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable =no,width=132,height=137,left=15,top=15')";
print "}";
print "-->";
print "</script>";

print "<TD><A HREF=\" javascriptpenwin($option[$i]);\">";
print "<IMG SRC=\"/images/nav/hear.gif\" BORDER=0>";
print "</A></TD>";

Any help appreciated,,,

Reply With Quote
  #2  
Old June 9th, 2001, 02:29 AM
Sheriff's Avatar
Sheriff Sheriff is offline
Oheim
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Austria
Posts: 69 Sheriff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Well, all this PHP script does, is output some JS code. Which you can change during the runtime of PHP.
PHP does not actually open the window, just generates the code for the client (browser) to then open up the new window.

Hope that helps...
Sheriff

Reply With Quote
  #3  
Old June 9th, 2001, 10:05 AM
bombel bombel is offline
,-)
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Germany
Posts: 13 bombel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
HI,

try to slim down the code because window won't open (especially in Netscape) if theres a slight misspelling.

How about this:

<a href=\"javascript: popupWin = window.open('http://mydomain.com/cgi-bin/something.php', 'width=132','height=137','left=15','top=15')\" >open window</a>

if this works (should) you can go on adding arguments so you see where the error is.


btw: why do you print all that stuff?

you can display it (outside php) as html and only put vars in php-brackets. So you will face lesser spelling-problems.


<script language="JavaScript">
<!--
function openwin(option)
{
popupWin = window.open('http://mydomain.com/cgi-bin/something.php?q_option=<?php
echo some optionvar; ?>', 'menubar=no','toolbar=no','location=no', 'directories=no','status=no','scrollbars=no','resizable
=no','width=132','height=137','left=15','top=15')";
}
-->
</script>

print "<TD><A HREF=\" javascriptpenwin($option[$i]);\">";
print "<IMG SRC=\"/images/nav/hear.gif\" BORDER=0>";
print "</A></TD>";



bombel

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > javascript window.open in PHP3 ?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap