Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2011
    Posts
    113
    Thanks
    9
    Thanked 1 Time in 1 Post

    Why will paypal not redirect while in iframe PAYING 2$ to get this fixed

    Basically I have a script iframed into a little sidebar widget on my main website
    http://blitz-gaming.net/mc/

    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

    http://blitz-gaming.net/paypal


    here is my page:

    PHP Code:
    [PHP]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <HEAD>
     <TITLE>Purchase</TITLE>
     <LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
    </HEAD>
    <BODY bgcolor="#1d1d1d">

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

    /*
    switch($rank) {

     case "Citizen":
      $price = 5;
     break;


    }
    */

       
    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 />
          </span>
    </font>
    <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">
    </form>
    <div style="margin:2px;"></div>
    <br />
    <form action="index.php">
    <input type="submit" class="button" value="<- Go back">
    </form>


    </BODY>
    </HTML>
    [/PHP]
    Last edited by Vernk; 02-20-2012 at 07:11 AM.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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>.

  • #3
    Regular Coder
    Join Date
    Oct 2011
    Posts
    113
    Thanks
    9
    Thanked 1 Time in 1 Post
    How would I do that?
    Last edited by Vernk; 02-20-2012 at 11:01 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •