SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to open this url in a new window ?

    Hello

    this line is in a php

    How to open this url in a new window

    function form_paypal ($transaction_id, $paypal_email, $payment_amount, $currency, $payment_description=null, $direct_payment=false, $post_url='https://www.paypal.com/cgi-bin/webscr')
    {
    (string) $display_output = null;

  2. #2
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    {
    echo "<a href=\"$post_url\" target=\"_blank\">$transaction_id</a>";

  3. #3
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello nginx

    thank you for your reply and code

    are you saying replace

    {
    (string) $display_output = null;

    with

    {
    echo "<a href=\"$post_url\" target=\"_blank\">$transaction_id</a>";

  4. #4
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, any one able to clarify this for me ?

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,195
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    This is not my area, but I'm sure that's not what's being said. The idea is to leave the code you posted as is but to then place the $post_url variable into the HTML inside an <a> element which also contains a target attribute of "_blank".

  6. #6
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello ralp.m

    I appreciate your reply,

    yes ok I see what you are saying, I will try your idea,

    yet if anyone else can clarify more, please jump in

    Quote Originally Posted by ralph.m View Post
    This is not my area, but I'm sure that's not what's being said. The idea is to leave the code you posted as is but to then place the $post_url variable into the HTML inside an <a> element which also contains a target attribute of "_blank".

  7. #7
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, I added the red, yet it is not correct, all ideas appreciated

    ### moneybookers form
    <a>
    function form_moneybookers ($transaction_id, $mb_email, $payment_amount, $currency, $direct_payment=false, $payment_description = null, $post_url='http://www.bangkokbank.com/Bangkok%20Bank/Pages/main.aspx')
    {
    (string) $display_output = null;
    {
    echo "<a href=\"$post_url\" target=\"_blank\">$transaction_id</a>";

  8. #8
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,332
    Mentioned
    192 Post(s)
    Tagged
    4 Thread(s)
    Please clarify what your intentions are here.
    You stated a desire to "open a link in a new window" but the code snippet you provided is a PHP function.
    Are you interested in displaying the value this function RETURNS in a new window? Without seeing the entire function I cannot even guess what it does - nonetheless what it maybe returns.

    Give us a little more detail and we can provide you a little more detailed assistance.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  9. #9
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello ParkinT

    I am not sure I can tell you much more,

    When the page 'image' is clicked on it opens the PayPal page in the same page/tab

    I wanted the https://www.paypal.com/cgi-bin/webscr to open in a new page/tab/blank

    ..............................................................................................................

    ### paypal form
    function form_paypal ($transaction_id, $paypal_email, $payment_amount, $currency, $payment_description=null, $direct_payment=false, $post_url='https://www.paypal.com/cgi-bin/webscr')
    {
    (string) $display_output = null;

  10. #10
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm, if you want open tab/window without user click its not allowed
    but, if you want open tab/window if user click on your link or image then here

    function form_paypal ($transaction_id, $paypal_email, $payment_amount, $currency, $payment_description=null, $direct_payment=false, $post_url='https://www.paypal.com/cgi-bin/webscr')
    {
    // if you want link
    echo "<a href=\"$post_url\" target=\"_blank\">$paypal_email - $transaction_id</a>";
    // if you want link with image
    echo "<a href=\"$post_url\" target=\"_blank\"><img src=\"your_image_link_here\"></a>";
    (string) $display_output = null;
    if u want, we can too show the link only if payment was success

  11. #11
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello nginx, thank you for your detailed reply,

    I will try/experiment with your suggested code yet, and will reply again once that is done

    Quote Originally Posted by nginx View Post
    hmm, if you want open tab/window without user click its not allowed
    but, if you want open tab/window if user click on your link or image then here

    if u want, we can too show the link only if payment was success


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
  •