Results 1 to 4 of 4

Thread: How to open link in new window using PHP

  1. #1
    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>

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    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">

  3. #3
    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!

  4. #4
    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

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,516,857.51167 seconds with 17 queries