Solved

Paypal page to iframe

Posted on 2014-03-22
5
955 Views
Last Modified: 2016-03-24
Here is my code:
<body onload = "document.forms.paypalform.submit();">
	<iframe src='about:blank' name='paypalframe' id='paypalframe' frameborder='1' height='500' width=100%'></iframe>
	<form name="paypalform" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypalframe">
		a bunch of hidden input tags for Paypal...
	</form>
</body>

Open in new window

The Paypal page does not appear in the iframe

The code works fine without the target tag and it works fine with the form's target="_blank" but the iframe just remains blank with the form's target="paypalframe".

The code is in a php script.

What's the problem?
TIA
0
Comment
Question by:thenelson
  • 3
  • 2
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39947489
Question doesn't make sense.
The iframe has no source so of course it will be blank.
Your paypal code has nothing to do with the iframe
0
 
LVL 39

Author Comment

by:thenelson
ID: 39947501
The form has a target tag: target="paypalframe"

See: http://www.w3schools.com/html/html_iframe.asp "Use iframe as a Target for a Link".
And http://www.w3schools.com/tags/att_form_target.asp "framename      The response is displayed in a named iframe"
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39947520
Ok missed that
You cannot load PayPal in an iframe, its a security risk and they prevent it happening.
0
 
LVL 39

Author Closing Comment

by:thenelson
ID: 39947561
Oh well, thanks.
0
 
LVL 39

Author Comment

by:thenelson
ID: 39947574
How about a followup question:
Using target="_blank"; when I submit the form with a button, the Paypal page loads into a new tab. When I submit the form with the onload event, the Paypal page loads into a new window. Any way to automatically submit the form to a new tab?
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ebay devID, appID, certID, userToken 2 30
Curl & PHP Command Help 4 23
website maintenance mode 1 17
Email called spam 5 13
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question