Javascript, being silly, has silly string rules:
function pop1($id) {
window.open("info.php?prod_id="+ $id);
}
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: Chris Knipe [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 06, 2002 2:50 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] [PLEASE HELP] Passing variable to new page.
>
>
> > echo "<script language=\"JavaScript\">";
> > echo" function pop1() {";
> > echo" window.open(\"info.php?prod_id=$result[0]\"); }"; \\
> $result[0] is
> > variable that stores id of the image in database
> > echo "</script>";
> >
> > I am calling this function in the following manner: echo"<img
> > onclick=\"pop1();\"";
> ^^^^^^^^^^^^^^^^^^^^^
>
> You're not passing a value to the variable. Try using
> something like: (i'm
> NO java guru, and this definately isn't the list for java)...
>
> function pop1($id) {
> window.open("info.php?prod_id=$id");
> }
>
> and
>
> <img src="blah" onclick="pop1(12345)">
>
> Where 12345 is the product ID that you assigned to variable
> prod_id, which
> will in return be displayed in the second PHP file. You're problem's
> related to the java script, not assigning the value to the
> variable. This
> isn't a PHP issue.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php