Question.. why are you opening up a full sized new window with the
javascript popup script?  I susspect the problem has something to do with
the javascript, although I'm not going to take the time to test it myself.
You can open a new page in an HTML link by setting target=new.  You
shouldn't have any problems.

<a href="";


----- Original Message -----
From: "Igor P." <[EMAIL PROTECTED]>
Sent: Thursday, June 06, 2002 12:37 PM
Subject: [PHP] [PLEASE HELP] Passing variable to new page.

> Hello,
> I am having hard time passing the variable to the next page. May be you
> help me. Let me explain:
> I am using mySQL database to store information about images (ID, name,
> author, description, etc). I am pulling some of the information to create
> this (look at the example here:
> Now, I want a new window
> appear when user clicks on the image. I have achieved it with the
> script:
> echo "<script language=\"JavaScript\">";
> echo" function pop1() {";
> echo"\"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 can see the result if you click on the image. The new page opens up,
> the id (product_id in this case) value is not passed to the next page
> correctly. If you click on the first or second image on the first page it
> shows that the ID is the same for both of them. However if you look at the
> source code you can see that the ids are assigned correctly. The same
> happens if you click on any image that says "no image available" (I am
> different script to generate those). It seems that the script picks up and
> stores in the memory the value of an ID of the last image generated with
> script (I don't know if that make sense).
> Oh, by the way the contents of info.php that I am calling in the script
> above are as following:
> <?
> $myid = $_GET['prod_id'];
> echo" Product ID: $myid<br>";
> ?>
> What am I doing wrong? Can you help?
> Thank you.
> --
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to