943,521 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 21096
  • PHP RSS
Nov 7th, 2008
0

open link in new window - PHP

Expand Post »
I would like to open the following link in a new window , can you pls. help me -



php Syntax (Toggle Plain Text)
  1. <?php
  2. $userfile= file_get_contents("out.txt");
  3. $users = explode("\n",$userfile);
  4. foreach ($users as $user) {
  5. list($name, $cor) = explode(" ", $user);
  6. echo "<a href=\"http://db.yeastgenome.org/cgi-bin/locus.pl?locus=".$name."\">$name </a>"."<br/>";
  7. }
  8.  
  9. ?>

thanks in advanced
Last edited by peter_budo; Nov 7th, 2008 at 4:02 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nufar is offline Offline
1 posts
since Nov 2008
Nov 7th, 2008
0

Re: open link in new window - PHP

Very simple, you can use either
<a href="..." target="_BLANK">...</a>
or use javascript function window.open() to open a new window having the link you specified
Reputation Points: 13
Solved Threads: 1
Newbie Poster
jack239 is offline Offline
14 posts
since Aug 2008
Nov 8th, 2008
0

Re: open link in new window - PHP

or try this:
PHP Syntax (Toggle Plain Text)
  1. <a href="javascript:;" onClick="window.open('yourpage.php','no','scrollbars=yes,width=550,height=400')" >Open</a>
Reputation Points: 137
Solved Threads: 162
Posting Virtuoso
Shanti C is offline Offline
1,641 posts
since Jul 2008
May 20th, 2010
0
Re: open link in new window - PHP
Hi all, i got an error in the page wich open the new one, somthing like this:

javascript%3Cb%3E%3C/b%3E:;

but y tried to delete one space in:

/*.............height=400')" >Open</a> changed to:
/*.............height=400')">Open</a>

and it looks like its work. i don't know if this is correct but you can check it.
Thanks for your help
Last edited by anduma; May 20th, 2010 at 8:35 pm. Reason: translated to english
Reputation Points: 10
Solved Threads: 0
Newbie Poster
anduma is offline Offline
1 posts
since May 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC