View Full Version : Paypal Buy Now Buttons Open in New Window

02-05-2007, 02:51 PM

I'm using iframes with my paypal buy now buttons is it possible to tell paypal to start in a new window as this is really messing up my design.

The code I've enter into a table cell is:-

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="sales@creativeauto.co.uk">
<input type="hidden" name="item_name" value="Angel Eyes">
<input type="hidden" name="item_number" value="0001">
<input type="hidden" name="amount" value="1.00">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="http://www.creativeauto.co.uk/paymentsuccess.html">
<input type="hidden" name="cancel_return" value="http://www.creativeauto.co.uk">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="http://www.creativeauto.co.uk/images/buy_btn_up.jpg" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="http://www.creativeauto.co.uk/images/buy_btn_over.jpg" width="1" height="1">

IS there anything I can add to make this open in a new window?

I've tried adding this as a regular link and it doesn't work.

Any suggestions???

I've called paypal but they're useless

02-05-2007, 07:21 PM
I'm using iframes with my paypal buy now buttons You will continue to get problems like this + usability, seo, accessability problems until you realize that you've chosen an archaic method of implementation. If you want scrollbars in your content, then simply use overflow: auto, we have a tutorials on this from the homepage. If you're doing this to keep your website looking consistent, you should either use the template system Dreamweaver already has built for this, or use a server side language for larger websites. I don't like saying it, but you need to hear it :(
I can't help you your problem, but in theory maybe it's possible you could force the form result to open in a new window, although I doubt it since the form action resides on paypals server.

02-05-2007, 09:36 PM
Thanks, I'll check out the tutorial.

I'm just using a method thats worked for me before but I'm always open to new methods still got much to learn.



02-05-2007, 09:43 PM
Why do you use iframes right now? Let me know and I'll let you know a possible better way of achieving the thing you're looking for 8-)

02-05-2007, 09:51 PM
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"
target="newwin" onsubmit="window.open('', this.target, 'width=50 height=100');>

02-05-2007, 10:41 PM
Thanks to both of you.

See the site I'm doing


The blank menu at the top is going to be done in flash so its just convenient to use an iframe to load the content.

Its actually working well but if you can suggest a better way then please do.

I have the paypal thing working now btw.

One other thing though regarding paypal buttons is it possible to have a roll over state?


02-05-2007, 10:45 PM
your calling your cart into an Iframe

this is a shame as the cart page is larger than the iframe dimensions and therefore producing horizontal scrolling

Is this going to change??

02-06-2007, 12:35 AM
no I'm not doing that mate, I wouldn't do that.

I'm actually using the cart code now rather than a buy now button and this opens in a new browser window so it works fine.

02-06-2007, 12:37 AM
Thanks for your help

I'll let you take a look at the site when its done I'd be interested in to know what you think.

02-06-2007, 01:30 AM
Instead of
<iframe src="file.html">

<? include('file.inc'); ?>

keeps your flash in one file still, but sorts all the problems you're getting from frames.

02-06-2007, 06:18 AM
yes but dont use inc as an extention as this could be downloaded if targeted directly.

Use php then if its targeted it will render in the browser displaying nothing more than an html constructed error message.

02-06-2007, 11:59 AM
That could be said for any other file extension as well if the server is not set up right.

02-06-2007, 12:53 PM
of course it can so best practice is to define your includes as .php rather than .inc

then the script is always processed through the PHP engine before being sent to the client which just sends back html

allot safer

02-06-2007, 01:18 PM
This is OT, but the reason people use INC files is that they benefit from grouping includes into one extension. Certain attributes (like it cannot be downloaded a s separate file), and it's usually not included as a 'page' in your website statistics (it's kind of funny when copyright.php is the most popular 'page' on your website because it got included on the bottom of every page.) Both extensions work, Ive used both, but I personally use .inc now. If security is a primary concern, .php is probably best in case the server has a hickup and stops parsing inc files as php.

Ricky, does it make sense to you how you can include a file into your main PHP page? It only works if your server supports PHP. If it doesn't, let us know what is.