Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help...Tricky link..... ;)

Status
Not open for further replies.

Naught

Programmer
Dec 19, 2002
3
DK
Hi!

How can I send a variable along with this link??

<a href=&quot;#&quot; class=&quot;links&quot; onClick=&quot;MyWindow=window.open
('hardwarelink.php,'MyWindow','toolbar=no,location=no,direct
ories=no,status=no,menubar=no,scrollbars=yes,resizable=no,wi
dth=500,height=500'); return false;&quot;>Links</a>


Normaly you couldt just add ?variable=&quot;$id&quot; just after the link.

ex. hardwarelink.php?user=&quot;$id&quot;

But this link wont accept &quot; or ' around the variable....

My link has to work as a kinda popup window, and at the same time send a variable to the opened window.....

Realy hope someone knows the awnser :)

------------------------------------

Lars Wolter // Naught

 
Code:
<a href=&quot;#&quot; class=&quot;links&quot; onClick=&quot;MyWindow=window.open
('hardwarelink.php?
user=\'$id\'','MyWindow','toolbar=no,location=no,directories
=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=5
00,height=500'); return false;&quot;>Links</a>
 
Try using \&quot; instead of &quot; around your variable, like this:
hardwarelink.php?user=\&quot;$id\&quot;
Hope I helped / Thanks for helping
if ((x<10&&y<10) &&(((parseInt(x.toString()+y.toString())-x-y)%9)!=0)){ alert(&quot;I'm a monkey's uncle&quot;); }
 
Supra, we must stop meeting like this! [lol] Hope I helped / Thanks for helping
if ((x<10&&y<10) &&(((parseInt(x.toString()+y.toString())-x-y)%9)!=0)){ alert(&quot;I'm a monkey's uncle&quot;); }
 
wow...fast reply ;)

Thx alot guys.....realy saved my day :)
 
Though.....I still cant get it to work :(

The variable contains \'$user_id\' .....and not the actual value of it :(
 
Do you mean this (?):
hardwarelink.php?user=<?= $id ?>

Rick
 
The way you have your code set up, you may NOT use \&quot;$id\&quot; you must use \'$id\'
 
You could also try this:
<a href=&quot;#&quot; class=&quot;links&quot; onClick=&quot;MyWindow=window.open('<?
sprintf(&quot;hardwarelink.php&quot;,$id) ?
>','MyWindow','toolbar=no,location=no,directories=no,status=
no,menubar=no,scrollbars=yes,resizable=no,width=500,height=5
00'); return false;&quot;>Links</a>

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top