New window with php variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
WayneG
Forum Newbie
Posts: 19
Joined: Thu Apr 02, 2009 6:53 am

New window with php variable

Post 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.
tech603
Forum Commoner
Posts: 84
Joined: Thu Mar 19, 2009 12:27 am

Re: New window with php variable

Post 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
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: New window with php variable

Post 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.
Post Reply