hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : open JAvascript popup from PHP
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

open JAvascript popup from PHP

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 12-27-2003, 10:10 AM
vientorio vientorio is offline
Newbie
 
Join Date: Dec 2003
Location: New Zealand
Posts: 15

open JAvascript popup from PHP


hello there,

I have a small problem with one of our customers PHP script. we mirror files for them and they use a dl.php file to get the file. When this dl.php file is displayed in a web browser we need it to open a pop up window

the top of the PHP file is as follows

Code:
print("<html>
<head>
<TITLE>Downloading...</TITLE>
<style type=\"text/css\">
<!--
     A:link {text-decoration: none;}
     A:visited {text-decoration: none;}
     A:hover {text-decoration: none;}
a:hover{color:red}
-->
</style>

</head>


we need to insert a link like this:

Code:
<SCRIPT LANGUAGE="JavaScript" src="URL/assign.php?l=vientorio&mode=behind"> </script>
Many thanks in advance for any help

Regards,
Geoff

Reply With Quote


Sponsored Links
  #2  
Old 12-27-2003, 10:23 AM
digitok digitok is offline
Web Hosting Master
 
Join Date: Jan 2003
Location: Perth, WA, Australia
Posts: 1,276
You mean popup a new site?...

echo '<script type="text/javascript">window.open(\'URL/assign.php?l=vientorio&mode=behind\');</script>';

__________________
nu-metal.org :: coming soon

Reply With Quote
  #3  
Old 12-27-2003, 10:36 AM
vientorio vientorio is offline
Newbie
 
Join Date: Dec 2003
Location: New Zealand
Posts: 15
Yes a new site... I added the script you specify like this
Code:
<?php

print("<html>
<head>
echo '<script type="text/javascript">window.open(\'httpmyurl/assign.php?l=vientorio&mode=behind\');</script>';
<TITLE>Downloading...</TITLE>
<style type=\"text/css\">
<!--
     A:link {text-decoration: none;}
     A:visited {text-decoration: none;}
     A:hover {text-decoration: none;}
a:hover{color:red}
-->
</style>

</head>
But i get this error

Parse error: parse error, unexpected T_STRING in C:\Inetpub\Mirrors\dl.php on line 5


line 5 is this:
Code:
echo '<script type="text/javascript">window.open(\'httpmyurl/assign.php?l=vientorio&mode=behind\');</script>';
Many thnaks i am closer now than ever
httpmyurl is the domain, i cannot post urls yet


Last edited by vientorio; 12-27-2003 at 10:46 AM.
Reply With Quote
Sponsored Links
  #4  
Old 12-27-2003, 11:39 AM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
Quote:
Originally posted by vientorio
Yes a new site... I added the script you specify like this
Code:
<?php

print("<html>
<head>
echo '<script type="text/javascript">window.open(\'httpmyurl/assign.php?l=vientorio&mode=behind\');</script>';
<TITLE>Downloading...</TITLE>
<style type=\"text/css\">
<!--
     A:link {text-decoration: none;}
     A:visited {text-decoration: none;}
     A:hover {text-decoration: none;}
a:hover{color:red}
-->
</style>

</head>
But i get this error

Parse error: parse error, unexpected T_STRING in C:\Inetpub\Mirrors\dl.php on line 5


line 5 is this:
Code:
echo '<script type="text/javascript">window.open(\'httpmyurl/assign.php?l=vientorio&mode=behind\');</script>';
Many thnaks i am closer now than ever
httpmyurl is the domain, i cannot post urls yet
You need to escape your single quotes... i.e. put a backslash in front of them

Reply With Quote
  #5  
Old 12-27-2003, 05:20 PM
vientorio vientorio is offline
Newbie
 
Join Date: Dec 2003
Location: New Zealand
Posts: 15
OK thanks, i got the script to stop throwing a n error, just now that it doesent open a popup window. i inserted the code like this
Code:
<?php

print("<html>
<head>
'<script type='text/javascript'>window.open(\'httpURL/assign.php?l=vientorio&mode=behind\');</script>';
<TITLE>Downloading...</TITLE>
<style type=\"text/css\">
<!--
     A:link {text-decoration: none;}
     A:visited {text-decoration: none;}
     A:hover {text-decoration: none;}
a:hover{color:red}
-->
</style>

</head>
have i missed somthing?

Reply With Quote
  #6  
Old 12-27-2003, 05:45 PM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
Yes your code is a bit of a mess, you're mixing up HTML, Javascript and PHP.

You don't need to single quotes before or after <script... /script> or the semi-colon at the end of the line.

Reply With Quote
  #7  
Old 12-27-2003, 07:00 PM
vientorio vientorio is offline
Newbie
 
Join Date: Dec 2003
Location: New Zealand
Posts: 15
Yes i agree with this script being a little messey, i do not own it nor can i totally adjust it, as the server admin i have been authorized by the client to add the code nessesary to open a bop behind window

Thankyou for looking into this

Regards,
Geoff

Reply With Quote
  #8  
Old 01-03-2004, 05:17 AM
vientorio vientorio is offline
Newbie
 
Join Date: Dec 2003
Location: New Zealand
Posts: 15
Solved

Thankyou to all who aided me in solving this issue. it now works!

Cheers,
Geoff

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Openwave Messaging Integrates Open-Xchange OX App Suite Web Hosting News 2013-04-04 11:03:35
WHD.global 2013: Open-Xchange Launches Browser-based Office Productivity Suite Web Hosting News 2013-03-20 06:55:56
Web Host Hostway Replaces Legacy Webmail with Open-Xchange Web Hosting News 2013-02-01 11:17:40
New Open-Xchange Cloud Application Suite Uses Responsive Design to Optimize Mobile Performance Web Hosting News 2012-11-15 13:43:31
Rackspace Testing OpenStack-Powered Cloud Servers on a Greater Scale Web Hosting News 2012-02-29 17:04:44


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?