473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

window.open in a php script

Hi-I'm stuck again can anyone help me out here.
I'm trying to open a frame less window (popup) from within a PHP script
this is what it looks like before I had a play :((

$link = "<a
href=\"news.php?renew=0&mid=".$message_info->tp_message_id."&sign=".$sign."\
">";

My try:(

$link = '<a href="news.php?renew=0&mid="'.$message_info-onClick="javascript:
window.open('http://"news.php?renew=0&mid="'.$message_info-','rad','width=25
0,height=285,top=200,left=300,screenX=200,screenY= 300,scrollbars=no,resizabl
e=no');return false;" target="_self">tp_message_id.'&sign='.$sign.'>';

With my try the whole thing goes to pot.

Parse error: parse error, unexpected '=' in
/home/site/public_html/news/web/show_header.php on line 450

Regards
Chris

Jul 23 '05 #1
5 1337
Lee
Joker7 said:

Hi-I'm stuck again can anyone help me out here.
I'm trying to open a frame less window (popup) from within a PHP script
this is what it looks like before I had a play :((

$link = "<a
href=\"news.php?renew=0&mid=".$message_info->tp_message_id."&sign=".$sign."\
">";

My try:(

$link = '<a href="news.php?renew=0&mid="'.$message_info-onClick="javascript:
window.open('http://"news.php?renew=0&mid="'.$message_info-','rad','width=25
0,height=285,top=200,left=300,screenX=200,screenY =300,scrollbars=no,resizabl
e=no');return false;" target="_self">tp_message_id.'&sign='.$sign.'>';

With my try the whole thing goes to pot.

Parse error: parse error, unexpected '=' in
/home/site/public_html/news/web/show_header.php on line 450


When you cause PHP errors by modifying PHP code that you
don't understand, you should ask for help in a PHP group.

Jul 23 '05 #2

"Lee" <RE**************@cox.net> wrote in message
news:ct*********@drn.newsguy.com...
: header.php on line 450
:
: When you cause PHP errors by modifying PHP code that you
: don't understand, you should ask for help in a PHP group.
:

I have and PHP groups say go and ask in Javascript groups :(( as it's a
Javascript problem.

Chris
Jul 23 '05 #3
Joker7 wrote:


I have and PHP groups say go and ask in Javascript groups :(( as it's a
Javascript problem.

Chris


Definitely a PHP problem, the javascript is never called.
Mick
Jul 23 '05 #4
Lee
Joker7 said:


"Lee" <RE**************@cox.net> wrote in message
news:ct*********@drn.newsguy.com...
: header.php on line 450
:
: When you cause PHP errors by modifying PHP code that you
: don't understand, you should ask for help in a PHP group.
:

I have and PHP groups say go and ask in Javascript groups :(( as it's a
Javascript problem.


They're just trying to blow you off.

Here's the line before you mangled it. I've separated it into separate lines at
the concatination operators "."

$link = "<a href=\"news.php?renew=0&mid=" .
$message_info->tp_message_id .
"&sign=" .
$sign .
"\">";

Every thing there from the opening \" (on the first line) to the closing
\" (on the last line) is what's being assigned to the HREF attribute.

When you edited it, you dropped code beginning with "onClick" right smack
in the middle of the second operand. That's a PHP error.

the beginning of the line you wound up with is:

$link = '<a href="news.php?renew=0&mid="' .
$message_info-onClick="javascript:window.open('http://"

I'm guessing that you thought that the ">" marked the end of the
<a> tag, but in this context, it was actually part of the "->" operator.
So, in addition to breaking the "$message_info->tp_message_id" identifier,
you've added a second "=" to an assignment statement. That's what the PHP
compiler was complaining about.

These are all PHP errors.

Jul 23 '05 #5
In article <35*************@individual.net>, sa******@hotmail.com
says...
Hi-I'm stuck again can anyone help me out here.
I'm trying to open a frame less window (popup) from within a PHP script
this is what it looks like before I had a play :((

$link = "<a
href=\"news.php?renew=0&mid=".$message_info->tp_message_id."&sign=".$sign."\
">";

My try:(

$link = '<a href="news.php?renew=0&mid="'.$message_info-onClick="javascript:
window.open('http://"news.php?renew=0&mid="'.$message_info-','rad','width=25
0,height=285,top=200,left=300,screenX=200,screenY= 300,scrollbars=no,resizabl
e=no');return false;" target="_self">tp_message_id.'&sign='.$sign.'>';

With my try the whole thing goes to pot.


That's because you're mucking around with the apostrophes. You start
your string with ', then you have them in your window.open function,
then you have them dotted through the code. Use \'.

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
1
by: bucrepus | last post by:
I know response.redirect doesn't open a new page. I have read many posts on how to fix this but I can't get the first one to work. Please help.. I have tried on 2 diff dev machines with no success...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
8
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript"...
6
by: Jack | last post by:
I have a main webpage that has a list of records, each with a link to a window.open function call. As an example, a page that opens is editrecord.aspx?RecordID=34, and another is...
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
1
by: Socrates | last post by:
Hi - Have tried for half and hour to get this script to work: I am trying to close the parent window while opening a centred new child window I would be grateful if someone could correct the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.