Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-10-2009
Member
 
Join Date: Jul 2009
Posts: 79
How to open link in new window using PHP

I would to open my link "Chat" in another page. I added the target = blank, yet it does nothing.

HTML Code:
<div class="menu"> 
 <span class="title-menu1">Forum</span></br> 
 <a href="{U_INDEX}" class="menu1">&bull; Forum </a></br> 
 <a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}" class="menu1">&bull; {L_FAQ} </a></br> 
 <a href="{U_CALENDAR}" class="menu1">&bull; Calendar </a></br> 
 <!-- IF S_DISPLAY_MEMBERLIST --><a href="{U_MEMBERLIST}" class="menu1">&bull; {L_MEMBERLIST} </a></br><!-- ENDIF --> 
 <!-- IF not S_IS_BOT --> 
 <a href="{U_LOGIN_LOGOUT}" class="menu1">&bull; {L_LOGIN_LOGOUT}</a></br> 
 
 <!-- IF S_DISPLAY_PM --><a href="{U_PRIVATEMSGS}" class="menu1">&bull; ( {PRIVATE_MESSAGE_INFO} )</a><br /><!-- ENDIF --> 
 <!-- ENDIF --> 
 <a href="{U_SEARCH}" class="menu1">&bull; {L_SEARCH}</a></br> 
 <!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED --><a href="{U_REGISTER}" class="menu1">&bull; {L_REGISTER}</a></br><!-- ENDIF --> 
  
 <!-- IF not S_IS_BOT and S_USER_LOGGED_IN --> 
 <a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="u" class="menu1">&bull; {L_PROFILE}</a></br> 
 
 <a href="{U_SEARCH_SELF}" class="menu1">&bull; {L_SEARCH_SELF}</a></br> 
<br> 
  
 <div class="menu-hr"></div> 
 
 <span class="title-menu1">The sites</span></br> 
 <a href="http://www.for_example.com" class="menu1">&bull; The site </a></br> 
 <a href="http://www.for_example.com/regions.php" class="menu1">&bull; Concession</a></br> 
 <a href="http://www.example1.com/forum/index.php" class="menu1">&bull; Example1</a></br> 
 <a href="http://example2.net/forums.html" class="menu1">&bull; Example2</a></br> 
 <a href="http://for_example.com/forum/chat/" target="_blank" class="menu1">&bull; Chat</a></br> 
<br> 
 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
  <input type="hidden" name="cmd" value="_s-xclick"> 
  <input type="hidden" name="hosted_button_id" value="7504108"> 
  <input type="image" src="https://www.paypal.com/en_US/i/logo/paypal_logo.gif" border="0" name="submit" alt="PayPal - The solution of payment online with simple and most secure !"> 
</form> 
 <div class="menu-hr"></div>
Reply With Quote
  #2  
Old 14-10-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: How to open link in new window using PHP

It is said that target="_blank" not working in some cases, when the destination page is special or is poorly specified (which seems to be your case, because the address appears to be a directory rather than the name of a page).

It is also said that another method is

HTML Code:
<a href="link.html" onClick="popup = window.open('link.html', 'PopupPage', 'height=450,width=500,scrollbars=yes,resizable=yes'); return false" target="_blank">
Reply With Quote
  #3  
Old 14-10-2009
Member
 
Join Date: Jul 2009
Posts: 79
Re: How to open link in new window using PHP

Yes kind of pop-up in JavaScript! I had even tried putting a target = "_blank" yesterday but it did not worked. Thank you for you information. I'll try this, I had more thinking!
Reply With Quote
  #4  
Old 14-10-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: How to open link in new window using PHP

I hope the rest of the php code is not the image in your html code because if not, probably a security hole.

Ex:
1) We do not use </br> in this way. It uses the CSS with margin
2)
HTML Code:
<span class="title-menu1">The sites</span></br>
<a href="http://www.for_example.com" class="menu1">&bull; The site </a></br> 
 <a href="http://www.for_example.com/regions.php" class="menu1">&bull; Concession</a></br> 
 <a href="http://www.example1.com/forum/index.php" class="menu1">&bull; Example1</a></br> 
 <a href="http://example2.net/forums.html" class="menu1">&bull; Example2</a></br> 
 <a href="http://for_example.com/forum/chat/" target="_blank" class="menu1">&bull; Chat</a></br>
To make a list of links, use <ul> <li> and therefore no need of </br> or bull.

3) <div class="menu-hr"> </div> -> in my opinion, a simple </hr> with the proper css should do the trick
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to open link in new window using PHP"
Thread Thread Starter Forum Replies Last Post
To open a link from Google, I have to open in a new tab or window Bindaas-ER Technology & Internet 3 07-03-2011 04:02 AM
JavaScript - open link in same window using location.replace Elizabeth Allen Software Development 7 13-05-2010 12:08 PM
Open image link in new window using HTML gazwsx Software Development 3 09-07-2009 08:27 PM
A link dosent open in New window in Internet Explorer why? Sawantji Technology & Internet 3 16-01-2009 06:38 PM
Can't open a link in new window in IE6 rupak Technology & Internet 3 12-01-2009 06:11 PM


All times are GMT +5.5. The time now is 02:32 PM.