functions.php 第2行处有输出
header函数执行时,不允许前面有输出
header函数执行时,不允许前面有输出
解决方案 »
- js表单项内如何加入php
- PHP 二进制压缩包 是什么?
- amfphp连接oracle 10g
- 谁有PHP+Socket编程例子,最好是服务器端和客户端应答信息互相通信。各位达人请进。。。
- 正则表达式匹配问题
- 求解:WINXP下 PHP5.04+APACHE2.54+MYSQL5.011 如何安装
- 今天看了一些论坛的代码,发现它们并没有用session_start().他们是这样实现session的呢。请高人分析先,如IPB论坛。
- 禁止用cookie之后,怎么用session?(没有可有分)
- PHP中移动文件的函数是什么
- 关于PHP拆分字符串的方法
- 在线HTML编辑器
- 初学者:配置完php.ini遇到的问题,不能找到动态库!
在functions.php 第2行处有输出中没有输出,只是在functions.php还有一个header()
是:Header("Content-type: image/PNG");
一;在Header前,不能有輸出語句,如Print,each等
二;在使用Header時,"<?php"這個語句必須在第一行.
再者Header("Content-type: image/PNG");这个语句是放在一个自定义函数中,没有执行这个函数则说明Header("Content-type: image/PNG");并没有被执行,应该也不会影响到usersave.php之中的header()
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也贴出来看看
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); }?>