我刚下了一个在线支付接口,运行了自己小改了一下,但是就是找不到是哪里问题,没改之前也报这样的错,因该不是我改过的原因,辛苦了,急死人了<?php
/*include("md5etopay.php");*/
?>
<?php$e_merchantsitecode="24ee38f7e5d00a6f";  /* e_merchantsitecode 为商户网站身份ID*/
$e_merchantcode="84b5ce8222390f00"  ;    /*e_merchantcode 为商户身份ID*/
$e_merchantkey="123123" ;                /*e_merchantkey 为您的密钥.建议您设置一个16位以上的密钥或更高.*/$e_url="http://www.cnbt8.com/bank/etopay/AutoReceive1topay.asp"; /*设置您的网站的实际回调通知地址 */
$e_return_url="http://www.cnbt8.com" /*设置您的网站的实际返回地址 ,换成您网站的一个返回页面*/
?><?php
session_start();
$e_gatewayurl="http://pay24ee38f7e5d00a6f.1topay.com/gateway.aspx";  /*设置您的网关*/
$_SESSION["name"]="savingmoney";
  /*创建订单号*/
 $sDate= time();
 $e_oid="201".date("y",$sDate).date("m",$sDate).date("d",$sDate).date("H",$sDate).date("i",$sDate).date("s",$sDate);        $e_amount =  trim($_POST['amount']);                 /*订单金额 */
        $e_paymode =  (Request.Form("paymode"));                /* 支付方式 */
        $e_paybankcode =  (Request.Form("paybankcode"));                /* 银行代码 */
        $e_cardnumber =  (Request.Form("cardnumber"));                /* 充值卡卡号 */
        $e_cardpassword =  (Request.Form("cardpassword"));                /* 充值卡金额 */
        //以下几项为购物信息,你可以从你的购物页面传过来,也可以用固定信息!开始 **************/
        $e_subject="addmoney"  ;           /*当你是一种商品时,这些是固定信息,你可以修改*/
        $e_body=$_SESSION["name"] ;          /*商品描述*/
        $e_price=$e_amount["savingmoney"];          /*购买单价 数量为1时单价等价于支付总额,这个一定不能有错误*/
        $e_quantity="1"        ;          /*购买数量  e_amount=e_price * e_quantity*/
        $e_note="add"          ;          /*备注信息*/       /*传值时用如下方式
       $e_note =$_GET["re"]                          ' 备注字段
        */$strtext="p01_service=interface_pay&p02_out_ordercode=".$e_oid."&p03_payamount=".$e_amount."&p04_sitecode=".$e_merchantsitecode."&p05_subject=".$e_subject."&p06_body=".$e_body."&p07_price=".$e_price."&p08_quantity=".$e_quantity."&p09_notify_url=".$e_url."&p10_note=".$e_note."&p13_paymode=".$e_paymode."&p14_paybankcode=".$e_paybankcode."&p15_cardnumber=".$e_cardnumber."&p16_cardpassword=".$e_cardpassword."&p17_return_url=".$e_return_url."&merchantcode=".$e_merchantcode."&merchantkey=".$e_merchantkey;
        /* 拼凑加密串*/
        $e_sign=strtolower(trim(md5($strtext))); /*加密字符串*/
         /*********** 可以在这里添加写入购买记录的数据库的操作***************/
?>
提示错误
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\web\sksgod\wwwroot\bank\etopay\Send1topay.php:2) in D:\web\wwwroot\bank\etopay\Send1topay.php on line 17Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\web\sksgod\wwwroot\bank\etopay\Send1topay.php:2) in D:\web\wwwroot\bank\etopay\Send1topay.php on line 17Fatal error: Call to undefined function form() in D:\web\wwwroot\bank\etopay\Send1topay.php on line 25

解决方案 »

  1.   

    你这是一个文件 还是两个文件 啊?
    session_start();
    必须在所有输出之前,若一定要在输入之后才有这句的话,在最前面加上ob_start();
    error: Call to undefined function form() in D:\web\wwwroot\bank\etopay\Send1topay.php on line 25这儿这个错误应该是少包含了文件 
      

  2.   

    LZ发出的代码是 Send1topay.php 的内容?
      

  3.   

    恩对,Send1topay.php的内容,也没有少包含文件
      

  4.   


     $e_paymode =  (Request.Form("paymode"));                /* 支付方式 */
            $e_paybankcode =  (Request.Form("paybankcode"));                /* 银行代码 */
            $e_cardnumber =  (Request.Form("cardnumber"));                /* 充值卡卡号 */
            $e_cardpassword =  (Request.Form("cardpassword"));                /* 充值卡金额 */这一部分怎么好像是 jsp 的写法,是不是有问题?把 session_start() 放在文件开头。或者前面加 @<?php
    session_start();
    /*include("md5etopay.php");*/
    ?>
      

  5.   

    要会看错误提示信息
    你的错误提示
    ... Send1topay.php:2) in D:\web\wwwroot\bank\etopay\Send1topay.php on line 17 
    是说在执行 Send1topay.php 的第 17 行(session_start();)时,发现 Send1topay.php 的第 2 行处有输出,违背了发送http协议头的规则。从你给出的代码看:session_start();位于从第一个 <?php 起的第 15 行,可见你的 Send1topay.php 文件在开始处至少存在 2 个空行;或是在编辑修改并保存为utf-8编码时采用了BOM类型相关信息参考
    http://www.google.cn/search?hl=zh-CN&rls=com.microsoft:zh-cn:IE-SearchBox&rlz=1I7BJYT_zh-CN&newwindow=1&q=utf-8+bom&revid=427302295&ei=bsclSrPXMtWLkAXtq83fBg&sa=X&oi=revisions_inline&resnum=0&ct=broad-revision&cd=5
      

  6.   

    session_start()前有输出
    Request.Form 难道你有一个Request的类,如果没有,这就是写错了.