954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

open link in new window - PHP

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

<?php
	$userfile= file_get_contents("out.txt");
       $users = explode("\n",$userfile);
      foreach ($users as $user) {
      list($name, $cor) = explode(" ", $user);
      echo "<a href=\"http://db.yeastgenome.org/cgi-bin/locus.pl?locus=".$name."\">$name  </a>"."<br/>";
       }

	?>


thanks in advanced

nufar
Newbie Poster
1 post since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

Very simple, you can use either
...
or use javascript function window.open() to open a new window having the link you specified

jack239
Newbie Poster
14 posts since Aug 2008
Reputation Points: 13
Solved Threads: 1
 

or try this:

<a href="javascript:;"  onClick="window.open('yourpage.php','no','scrollbars=yes,width=550,height=400')" >Open</a>
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
 

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 changed to:
/*.............height=400')">Open

and it looks like its work. i don't know if this is correct but you can check it.
Thanks for your help

anduma
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You