输出缓冲,解析错误意外t_string [英] output buffering, parse error unexpected t_string

查看:84
本文介绍了输出缓冲,解析错误意外t_string的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试使用输出缓冲来作弊,所以我可以打印出优秀的

,这比这个标题()更晚。

header(" Content-type:application / xmsdownload");

header(" Content-Disposition:attachment;

header( Pragma:no-cache);

header(" Expires; 0");

print" $ header \ n $ data";

这是它与之冲突的标题行,所以我用

缓冲区包围它。

ob_start()

header (''Content-type:text / html; charset = \" $ CHARSET \"'');

obj_end_flush()

退出;


我有一个问题是这个缓冲区应该围绕整个php

页面还是只有令人讨厌的标题行?


我在标题行上收到错误消息解析错误:语法

错误,/home/allrail/public_html/header.php中的意外T_STRING

第39行"


我把缓冲区放在它周围之前有效吗?


谢谢,



I''m trying to use output buffering to cheat so i can print to excel
which is called later than this header().
header("Content-type: application/xmsdownload");
header("Content-Disposition: attachment;
header("Pragma: no-cache");
header("Expires; 0");
print "$header\n$data";
This is the header line it conflicts with so I surrounded it with the
buffer.
ob_start()
header( ''Content-type: text/html; charset=\"$CHARSET\"'' );
obj_end_flush()
exit;

I have a question is this buffer supposed to go around the whole php
page or only the offending header line?

I am getting an error message on the header line " Parse error: syntax
error, unexpected T_STRING in /home/allrail/public_html/header.php on
line 39"

It worked before I put the buffer around it?

thanks,

推荐答案

header \ n
header\n


data" ;;

这是标题它与它冲突,所以我用

缓冲区包围它。

ob_start()

header(''Content-type:text / html ; charset = \"
data";
This is the header line it conflicts with so I surrounded it with the
buffer.
ob_start()
header( ''Content-type: text/html; charset=\"


CHARSET \"'');

obj_end_flush()

退出;


我有一个问题是这个缓冲区应该围绕整个php

页面还是只有令人讨厌的标题行?


我在标题行上收到错误消息解析错误:语法

错误,/home/allrail/public_html/header.php中的意外T_STRING

第39行"


我把缓冲区放在它周围之前有用吗?


谢谢,

CHARSET\"'' );
obj_end_flush()
exit;

I have a question is this buffer supposed to go around the whole php
page or only the offending header line?

I am getting an error message on the header line " Parse error: syntax
error, unexpected T_STRING in /home/allrail/public_html/header.php on
line 39"

It worked before I put the buffer around it?

thanks,


这篇关于输出缓冲,解析错误意外t_string的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆