View Full Version : Why will paypal not redirect while in iframe PAYING 2$ to get this fixed

02-20-2012, 06:56 AM
Basically I have a script iframed into a little sidebar widget on my main website

As you can see, but when you try to purchase a rank, it doesn't redirect to paypal. It usually would, it worked before

It works on the normal version here


here is my page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
<BODY bgcolor="#1d1d1d">

require "config.inc.php";
$rank = $_POST['rank'];
$username = $_POST['username'];
if (isset($username)) {
} else {
header ("Location: index.php");
if (isset($rank)) {
} else {
header ("Location: index.php");

switch($rank) {

case "Citizen":
$price = 5;


if ($rank == $rank1) {
$price = $rank1_price;
} if ($rank == $rank2) {
$price = $rank2_price;
} if ($rank == $rank3) {
$price = $rank3_price;
} if ($rank == $rank4) {
$price = $rank4_price;
} if ($rank == $rank5) {
$price = $rank5_price;
} if ($rank == $rank6) {
$price = $rank6_price;
} if ($rank == $rank7) {
$price = $rank7_price;

<span class="text">
<font size="2px" color="#8099FF">Your account can be online<br /> or offline during this process</font><br />
<font size="2px" color="#FFA6E7">You must have been on the <br />server once for this to work</font><br />
<div class="box2">Rank : <?php echo $rank; ?><br />
User: <?php echo $username; ?><br />
IP: <?php echo $ip; ?><br />
Price: $<?php echo $price; ?>.00 <br /></div>
<font color="red">Make sure you're<br /> information is correct!</font><br />
<br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="POST">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="vernk@techie.com">
<input type="hidden" name="item_name" value="<?php echo $rank; ?>">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="<?php echo $price; ?>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="return" value="http://blitz-gaming.net/paypal/thankyou.html">
<input type="hidden" name="cancel_return" value="http://blitz-gaming.net/paypal/sorry.html">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="notify_url" value="http://blitz-gaming.net/paypal/ipn.php" />
<input type="hidden" name="custom" value="<?php echo $username; ?>">
<input type="submit" class="button" value="Complete Purchase">
<div style="margin:2px;"></div>
<br />
<form action="index.php">
<input type="submit" class="button" value="<- Go back">


02-20-2012, 01:44 PM
You can't use PayPal within an <iframe>.
PayPal won't allow that for security reasons.

I suggest you use Express Checkout instead (see PayPal's API documentation),
or put your widget inside a <div> instead of <iframe>.

02-20-2012, 10:53 PM
How would I do that?