English 中文(简体)
PHP & WordPress: Headers have been sent - what to do? [复制]
原标题:PHP & WordPress: headers already sent - what to do? [duplicate]

我正在制作一个言语版模板,把我的FTP的档案列入其中。 如果我点击档案I打电话d.php(d=download),那我就走过档案的道路,我想用下载。

header( Content-Disposition: attachment; filename=" . $file . " );

这不利于我,因为浏览器让我知道:

警告:坎诺不修改标题信息——已经由以下单位发送的头盔(产出始于/客户数据/n5200-2-dynamic/a/l/mydomain.net.au/www/wp-content/themes/mytheme/d.php:25) 第45条

我可以做些什么? d.php甚至包括任何言语(目标——头盔或脚(脚))——它只是我的主题的模版目录中一个简单的网站。 我可以做些什么?

感谢

最佳回答

在使用PHP的<代码>header()功能时,必须在发送任何产出之前发出。 这意味着必须在<代码><html> tag之前执行。 这将意味着在程序上更早的文字中加入。

问题回答

我相信言语会穿上一切ru缩指数.php,因此,从技术上讲,你被装在言语中。

不管怎样,有人在你面前寄来头脑。 这可以是白天空间、购买力平价产出,甚至可能是实际头盔。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签