Php 标题位置不工作

Php 标题位置不工作,php,paypal,Php,Paypal,这是我的贝宝返回页面。在这个页面上,我想捕获事务的细节,并将细节插入到工作正常的数据库中。不幸的是,在处理完所有内容后,页面没有重定向到成功页面paypal_success.php。我做得不对的是什么 这是我的密码: <?php ob_start(); /*database variables*/ $host="localhost"; $db_username="myusername"; $password="mypassword"; $db="mydb"; /*tables*/ $tb

这是我的贝宝返回页面。在这个页面上,我想捕获事务的细节,并将细节插入到工作正常的数据库中。不幸的是,在处理完所有内容后,页面没有重定向到成功页面paypal_success.php。我做得不对的是什么

这是我的密码:

<?php
ob_start();
/*database variables*/
$host="localhost";
$db_username="myusername";
$password="mypassword";
$db="mydb";

/*tables*/
$tbl_users="users";
$tbl_orders="orders";
$tbl_attachments="attachments";
$tbl_admin_attachments = "admin_attachments";
$tbl_payments = "payments";

/*paypal identity token*/
$paypal_identity_token = 'myidtoken';

$dbc=new mysqli("$host","$db_username","$password","$db");

if($dbc->connect_errno > 0){

  die('Unable to connect '.$dbc->connect_errno);

}

include 'core/general.functions.php';
include 'core/users.functions.php';


     // The unique transaction id. 
     if(isset($_GET['tx'])){

        $tx= $_GET['tx']; 
     }

     $identity =$paypal_identity_token; 
    // Init curl
    $ch = curl_init(); 
    // Set request options 
   curl_setopt_array($ch, array ( CURLOPT_URL =>        'https://www.sandbox.paypal.com/cgi-bin/webscr',
   CURLOPT_POST => TRUE,
   CURLOPT_POSTFIELDS => http_build_query(array
   (
      'cmd' => '_notify-synch',
      'tx' => $tx,
      'at' => $identity,
   )),
   CURLOPT_RETURNTRANSFER => TRUE,
   CURLOPT_HEADER => FALSE,
  // CURLOPT_SSL_VERIFYPEER => TRUE,
  // CURLOPT_CAINFO => 'cacert.pem',
   ));
  // Execute request and get response and status code
  $response = curl_exec($ch);
  $status   = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  // Close connection
  curl_close($ch);

 if($status == 200 AND strpos($response, 'SUCCESS') === 0)
 {   
      // parse the data
     $lines = explode("\n", $response);
     $keyarray = array();
    if(strcmp ($lines[0], "SUCCESS") == 0){

        for ($i=1; $i<count($lines);$i++){

        list($key,$val) = explode("=", $lines[$i]);
        $keyarray[urldecode($key)] = urldecode($val);

        }//for

        $firstname = $keyarray['first_name'];
        $lastname = $keyarray['last_name'];
        $amount = $keyarray['payment_gross'];
        $user_id = $keyarray['custom'];
        $order_id = $keyarray['item_name'];
        $trx_id = $keyarray['txn_id'];
        $currency = $keyarray['mc_currency'];
        $payment_status = $keyarray['payment_status'];
        $payer_email = $keyarray['payer_email'];



       // check whether the payment_status is Completed
       // check that txn_id has not been previously processed
       //insert the payment record into the db

       if($payment_status == 'Completed' && check_txn_id($trx_id,$dbc,$tbl_payments) == false){

            insert_payments($amount,$currency,$user_id,$order_id,$trx_id,$dbc,$tbl_payments);
            //update payment order status
            update_payment_status($order_id,$user_id,$dbc,$tbl_orders);             

              header('location:paypal_success.php?success');


       }

    }else if(strcmp ($lines[0], "FAIL") == 0) {



    }

}
$dbc->close();
?>

看,谢谢…使用绝对网址和死,它的工作只是罚款