Re: Javascript & PHP??

From: "Adam Lang" <aalang(at)rutgersinsurance(dot)com>
To: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Javascript & PHP??
Date: 2001-03-12 20:20:10
Message-ID: 005d01c0ab31$d68d3720$1b9e0141@glou1.nj.home.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

You are correct. When you are first using $temp, it has no value. You
never assigned anything to it.

To fix it, put this:
> $temp = $currentCombinedRow[15]; file://location of image!
before you try to use $temp.

----- Original Message -----
From: "Richie" <dugganr(at)student(dot)cs(dot)ucc(dot)ie>
To: <pgsql-php(at)postgresql(dot)org>
Sent: Saturday, March 10, 2001 12:48 PM
Subject: [PHP] Javascript & PHP??

> Hi
>
> I have a Javascript function which is supposed to open up a seperate
> window with an image from the database. The image location is just stored
> on the database and it is returned back from the database no problem. Lets
> say I assign a variable $temp to be equal to the location. I then create a
> link which when the user clicks it will start a Javascript which is
> supposed to read the value of $temp and open up a window accordingly.
> However all it does is open up a blank window. Here is my script...
>
> <?
> printf("<script language=\"javascript\">");
> printf("function liveWindow(){var
>
liveWindow4=window.open(\"$temp\",liveWindow4,\"width=310,height=420,toolbar
=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directorie
s=0,status=0,copyhistory=0,maximise=no,left=30,top=30\");}");
> printf("</script>");
> ....
> and then somewhere further on....
>
> $temp = $currentCombinedRow[15]; file://location of image!
> printf("<A HREF =\"javascript:onclick=liveWindow()\">Click for
> image</A>");
>
> My guess is that the line I give $temp a value is AFTER the Javascript
> definition so maybe the Javacript thinks that $temp has no
> value yet?? So is this my problem and if so is there any
> way around it because Javascript does have to be inside the head doesn't
> it?
>
> Any ideas would be very much appreciated!
>
> Cheers,
>
> Richie
> =========================================================
> Richie Duggan
> Computer Science IV
> University College Cork
> Eamil : dugganr(at)student(dot)cs(dot)ucc(dot)ie richie_dug(at)yahoo(dot)com
> Homepage : http://student.cs.ucc.ie/01/dugganr/index.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Paul Joseph McGee 2001-03-13 17:20:57 Secure pages
Previous Message Louis Bertrand 2001-03-12 04:33:20 Re: Javascript & PHP??