open link in new window - PHP

Reply

Join Date: Nov 2008
Posts: 1
Reputation: nufar is an unknown quantity at this point 
Solved Threads: 0
nufar nufar is offline Offline
Newbie Poster

open link in new window - PHP

 
0
  #1
Nov 7th, 2008
I would like to open the following link in a new window , can you pls. help me -



  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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 14
Reputation: jack239 is an unknown quantity at this point 
Solved Threads: 1
jack239's Avatar
jack239 jack239 is offline Offline
Newbie Poster

Re: open link in new window - PHP

 
0
  #2
Nov 7th, 2008
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
Stuck in the middle of Java/PHP/Ajax development?

For free help on any technology and free articles visit http://www.techcubetalk.com
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,072
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: open link in new window - PHP

 
0
  #3
Nov 8th, 2008
or try this:
  1. <a href="javascript:;" onClick="window.open('yourpage.php','no','scrollbars=yes,width=550,height=400')" >Open</a>
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC