pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedJavascript & PHP??
3+ messages / 3 participants
[nested] [flat]
* Javascript & PHP??
@ 2001-03-10 17:48 Richie <dugganr@student.cs.ucc.ie>
2001-03-12 04:33 ` Re: Javascript & PHP?? Louis Bertrand <louis@bertrandtech.on.ca>
2001-03-12 20:20 ` Re: Javascript & PHP?? Adam Lang <aalang@rutgersinsurance.com>
0 siblings, 2 replies; 3+ messages in thread
From: Richie @ 2001-03-10 17:48 UTC (permalink / raw)
To: pgsql-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,directories=0,status=0,copyhistory=0,maximise=no,left=30,top=30\");}");
printf("</script>");
....
and then somewhere further on....
$temp = $currentCombinedRow[15]; //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@student.cs.ucc.ie richie_dug@yahoo.com
Homepage : http://student.cs.ucc.ie/01/dugganr/index.html
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Javascript & PHP??
2001-03-10 17:48 Javascript & PHP?? Richie <dugganr@student.cs.ucc.ie>
@ 2001-03-12 04:33 ` Louis Bertrand <louis@bertrandtech.on.ca>
1 sibling, 0 replies; 3+ messages in thread
From: Louis Bertrand @ 2001-03-12 04:33 UTC (permalink / raw)
To: Richie <dugganr@student.cs.ucc.ie>; +Cc: pgsql-php
Why not pass the current value of $temp as an argument to liveWindow()?
That way you know for sure what the function is getting.
Ciao
--Louis <louis@bertrandtech.on.ca>
On Sat, 10 Mar 2001, Richie wrote:
> 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,directories=0,status=0,copyhistory=0,maximise=no,left=30,top=30\");}");
> printf("</script>");
> ....
> and then somewhere further on....
>
> $temp = $currentCombinedRow[15]; //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@student.cs.ucc.ie richie_dug@yahoo.com
> Homepage : http://student.cs.ucc.ie/01/dugganr/index.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Javascript & PHP??
2001-03-10 17:48 Javascript & PHP?? Richie <dugganr@student.cs.ucc.ie>
@ 2001-03-12 20:20 ` Adam Lang <aalang@rutgersinsurance.com>
1 sibling, 0 replies; 3+ messages in thread
From: Adam Lang @ 2001-03-12 20:20 UTC (permalink / raw)
To: 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@student.cs.ucc.ie>
To: <pgsql-php@postgresql.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@student.cs.ucc.ie richie_dug@yahoo.com
> Homepage : http://student.cs.ucc.ie/01/dugganr/index.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-03-12 20:20 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-10 17:48 Javascript & PHP?? Richie <dugganr@student.cs.ucc.ie>
2001-03-12 04:33 ` Louis Bertrand <louis@bertrandtech.on.ca>
2001-03-12 20:20 ` Adam Lang <aalang@rutgersinsurance.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox