functions.php 第2行处有输出
header函数执行时,不允许前面有输出

解决方案 »

  1.   

    header函数执行时不能有输出语句
      

  2.   

    TO:回复人: xuzuning(唠叨)
    在functions.php 第2行处有输出中没有输出,只是在functions.php还有一个header()
    是:Header("Content-type: image/PNG");
      

  3.   

    有兩點要注意
    一;在Header前,不能有輸出語句,如Print,each等
    二;在使用Header時,"<?php"這個語句必須在第一行.
      

  4.   

    TO:xuzuning(唠叨)那是不是要把Header("Content-type: image/PNG");这句改成:<meta http-equiv="Content-Type" content="iamge/PNG; charset=gb2312">放在图片输出文件的<head></head>之中呢?
      

  5.   

    TO:TO:xuzuning(唠叨)
    再者Header("Content-type: image/PNG");这个语句是放在一个自定义函数中,没有执行这个函数则说明Header("Content-type: image/PNG");并没有被执行,应该也不会影响到usersave.php之中的header()
      

  6.   

    根据这个错误
    error,Cannot modify header information - headers already sent by (output started at D:\webs\autowebs\ocen\admin\include\functions.php:2) in D:\webs\autowebs\ocen\usersave.php on line 15
    肯定是在header("location:PageInfo.asp?InfoType=RegErr&InfoNum=$eventid");
    前面有输出
    不如把functions.php也贴出来看看
      

  7.   

    TO:luxuezhu(卢冲)
    functions.php的文件是:
    <?function EventLog($EventType,$EventName,$EventDescription,$CheckNum,$UserAccount,$UserIP)
      {
       global     $db, $card_data_eventlog_table;
       
      $sql = "insert into $card_data_eventlog_table(eventtype,eventname,eventdescription,checknum,useraccount,userip,addtime) values ('$EventType','$EventName','$EventDescription','$CheckNum','$UserAccount','$UserIP','ghjg')";
       $db->query($sql);
      $sql="select  max(id) from  $card_data_eventlog_table";
      $db->query($sql);
      return $EventLog=$db->f(id);
      }
    //////////////////////生成校号=============
    function GetCheckStr()
    {
    global $sessionchecknum;
    while(($authnum=rand()%10000)<1000);  
    return $sessionchecknum=$authnum;
    }
    function GetCheckImage($CheckStr)
    {
       /* 
        *   Filename:    authimg.php 
        *   Author:   hutuworm 
        *   Date:   2003-04-28 
        *   @Copyleft    hutuworm.org 
        */    //生成验证码图片 
            Header("Content-type: image/PNG");  
            srand((double)microtime()*1000000); 
            $im = imagecreate(58,28); 
            $black = ImageColorAllocate($im, 0,0,0); 
            $white = ImageColorAllocate($im, 255,255,255); 
            $gray = ImageColorAllocate($im, 200,200,200); 
            imagefill($im,68,30,$gray); 
       //将四位整数验证码绘入图片 
            imagestring($im, 5, 10, 8, $CheckStr, $black);         for($i=0;$i<50;$i++)   //加入干扰象素 
            { 
                    imagesetpixel($im, rand()%70 , rand()%30 , $black); 
            }         ImagePNG($im); 
            ImageDestroy($im); }?>