Re: FN-FORUM: PHP coding help
date posted 15th August 2003 17:00
John Anderson wrote:
> This is doing my head in.
>
> I have two lines of code in PHP:
>
> $windowString = "\"closeup.php?photoname=$picString1$picString2\",
> \"new\",
> \"toolbar=no,status=no,scrollbars=no,width=600,height=450\""; print
> "";
>
> which produces the following lines:
>
> HREF="javascript:newWin=window.open("closeup.php?photoname=sadell",
> "new", "toolbar=no,status=no,scrollbars=no,width=600,height=450");">
>
> However, when I pass the mouse over the linked image, I get:
>
> javascript:window.open(
>
> and an error.
I think...
Try replacing the double quotes around windowString with single quotes.
Javascript likes single quotes. Also it's good practice, when mixing
string with variables, to concatenate them together correctly. Although
PHP usually knows what you mean it can cause problems...
e.g.
$myvar = "Hear no evil,". $evil .", speak no evil";
Cheers
George
--
Layer1
http://www.layer1.co.uk
t: +44 (20) 8567 5923 m: +44 (7801) 945164