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 :slight_smile:

function form_paypal ($transaction_id, $paypal_email, $payment_amount, $currency, $payment_description=null, $direct_payment=false, $post_url=‘[COLOR=“#0000FF”]https://www.paypal.com/cgi-bin/webscr[/COLOR]’)
{
(string) $display_output = null;

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

Hello nginx

thank you for your reply and code :slight_smile:

are you saying replace

{
(string) $display_output = null;

with

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

Hi, any one able to clarify this for me ?

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”.

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 :slight_smile:

Hi, I added the red, yet it is not correct, all ideas appreciated :slight_smile:

moneybookers form

  [COLOR="#FF0000"]  &lt;a&gt;[/COLOR]
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;
   [COLOR="#FF0000"] {
     echo "&lt;a href=\\"$post_url\\" target=\\"_blank\\"&gt;$transaction_id&lt;/a&gt;"; [/COLOR]

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.

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='[COLOR="#FF0000"]https://www.paypal.com/cgi-bin/webscr[/COLOR]')

{
(string) $display_output = null;

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

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 :slight_smile: