Actually Jon, the IDs are not exactly expressed that way, but your
example gave me a nice idea... To tell you the truth (and now that I
have a clearer idea of what to do), the id I need to pass along is from
a random quote (or FAQ) but I'll fetch it before script is being
declared (even before the HTML tag) and then target the script to a
moreinfo.php?var=varvalue page... (does that make any sense?)

thanks a lot.

Cesar L. Aracena
(0299) 156-356688
Neuquén (8300) Capital

-----Mensaje original-----
De: Jon Haworth [mailto:[EMAIL PROTECTED]] 
Enviado el: miércoles, 18 de diciembre de 2002 8:08
Para: 'Cesar Aracena'; 'Php-General@Lists. Php. Net'
Asunto: RE: [PHP] Javascript var to PHP

Hi Cesar,

> Jon, thanx for the fast response, but the problem is 
> that the link is made dynamically from a DB and the varvalue 
> changes on every link... if it helps, I make this link 
> list with a FOR loop in PHP and the varvalues
> I want to pass are the IDs of a table elements.

You probably need to do it along these lines:

// assume ids are in $id[1...10]
for ($i = 1; $i <= 10; $i++) { 
  echo '<a href="javascript:lauchinfopage(';
  echo $id[$i];
  echo ')">click for more info</a><br />";

and, in your JS function:

function launchinfopage(id)
  url = "infopage.php?id=" + id;
  // open url however you like

I imagine you have your url hardcoded in your launchinfopage()
this makes it less portable, you may want to consider passing the
url to a generic "open new window" function.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to