Page 1 of 1

New window with php variable

Posted: Sat Apr 11, 2009 4:15 pm
by WayneG
I'm trying to open a link from a table row into a new window.
This is the code, which doesn't work.
Probably a simple answer, but I can't find it:

<TD WIDTH="180"><a href="javascript:void(0)" onClick="window.open('<?php echo no$match_no/scanned.php','guide', 'height=700, width=300, scrollbars=yes')"</a>; ?></TD>

Hope you can help.
Wayne.

Re: New window with php variable

Posted: Sat Apr 11, 2009 6:12 pm
by tech603
One of the easiest ways to pass a variable to a new window is to put it into the url and grab it on the next page. This tutorial should help you understand that process better

http://www.w3schools.com/PHP/php_get.asp

hope that helps

Re: New window with php variable

Posted: Sat Apr 11, 2009 6:52 pm
by McInfo
WayneG wrote:<TD WIDTH="180"><a href="javascript:void(0)" onClick="window.open('<?php echo no$match_no/scanned.php','guide', 'height=700, width=300, scrollbars=yes')"</a>; ?></TD>
I'm not sure exactly what you are trying to do, but maybe this?

Code: Select all

<td width="180"><a href="<?php echo $match; ?>" target="_blank"><?php echo $match; ?></a></td>
Edit: This post was recovered from search engine cache.