Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-20-2012, 06:56 AM   PM User | #1
Vernk
Regular Coder

 
Join Date: Oct 2011
Posts: 113
Thanks: 9
Thanked 1 Time in 1 Post
Vernk is an unknown quantity at this point
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..
Vernk is offline   Reply With Quote
Old 02-20-2012, 01:44 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
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>.
mlseim is offline   Reply With Quote
Old 02-20-2012, 10:53 PM   PM User | #3
Vernk
Regular Coder

 
Join Date: Oct 2011
Posts: 113
Thanks: 9
Thanked 1 Time in 1 Post
Vernk is an unknown quantity at this point
How would I do that?

Last edited by Vernk; 02-20-2012 at 11:01 PM..
Vernk is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:53 AM.


Advertisement
Log in to turn off these ads.