php/javascript woes
Ronnie Gauthier
ronnie at instaguide.com
Wed Apr 16 16:33:09 PDT 2008
A double quoted var will extrapolate vaiables, single quotes will just print
out the pointer.
A=1;
echo "$A"; =1
echo '$A'; = $A
Ronnie
----- Original Message -----
From: "Lonni J Friedman" <netllama at gmail.com>
To: "Linux tips and tricks" <linux-users at linux-sxs.org>
Sent: Wednesday, April 16, 2008 5:07 PM
Subject: php/javascript woes
> Any php/javascript experts here? I'm attempting to use javascript for
> the first time inside of php, and its going poorly.
>
> I'm working on a project that is primarily written in PHP, and I want
> to have a URL which has PHP variables embedded in it appear in an
> overlib(js) popup window. I'm currently running into a nasty problem
> where the overlib enabled links on the main page fail to work at all,
> and in the Firefox Error Console I see:
> ########
> Error: missing ) after argument list
> Source File: http://reports/nightly-chart/chart1.php
> Line: 1, Column: 43
> Source Code:
> return overlib('<DIV id="overpop"><A
> HREF='http://reports/nightly/index.php?table_name=cudasmoke&function=details&where_field=id&where_value=70752'
> target=\'_blank\'>Details</a><BR>Yet another line of text</DIV>',
> CAPTION, 'FAILED');
> ########
>
> The PHP code in question which generates this mess is:
> #############
> $url1='HREF=\'http://reports/nightly/index.php?table_name='.$table.'&function=details&where_field=id&where_value='.$url0.'\'
> ' ;
> print ("<td style=\"background: url(../newredhash.jpg) repeat;\"\><A
> HREF=\"javascript:void(0);\" onclick=\"return overlib('<DIV
> id="overpop"><A $url1
> target=\'_blank\'>Details</a><BR>Yet another line of
> text</DIV>', CAPTION, 'FAILED');\"
> onmouseout=\"nd(0);\">$rd</a></td>");
> #############
>
> I'm reasonably confident that the problem is with how the assorted
> quotes in $url1 are getting escaped, cause if I just hardcode the
> contents of $url1 inside of the php print statement (in place of
> $url1) it all works perfectly. Anyone see what I might be doing
> wrong?
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> L. Friedman netllama at gmail.com
> LlamaLand https://netllama.linux-sxs.org
> _______________________________________________
> Linux-users mailing list ( Linux-users at linux-sxs.org )
> Unsub/Password/Etc:
> http://linux-sxs.org/mailman/listinfo/linux-users
>
> Need to chat further on this subject? Check out #linux-users on
> irc.linux-sxs.org !
>
>
> --
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008
> 9:34 AM
>
>
More information about the Linux-users
mailing list