> 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