Solved

Paypal page to iframe

Posted on 2014-03-22
5
946 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now