我的文件中的PHP头问题
我在我的一份文件中报告了这个问题 警告:无法修改标题信息-标题已由第40行的/home/*/public_html/addengine/parseclick.php:1)中的/home/*/public_html/addengine/parseclick.php发送 这是实际文件的代码我的文件中的PHP头问题,php,Php,我在我的一份文件中报告了这个问题 警告:无法修改标题信息-标题已由第40行的/home/*/public_html/addengine/parseclick.php:1)中的/home/*/public_html/addengine/parseclick.php发送 这是实际文件的代码 <?php include_once("../admin/database.php"); $today = date("Y-m-d"); $data = str_replace(' ', '+'
<?php
include_once("../admin/database.php");
$today = date("Y-m-d");
$data = str_replace(' ', '+', $_GET['data']);
$de_data = decrypt($data,$ad_passcode='',$salt='');
$arr_data = explode(":",$de_data);
/*
Array: arr_data
arr_data[0] = pub_ad_id
arr_data[1] = adv_ad_id
arr_data[2] = compaign_id
*/
$pid = $arr_data[0];
$aid = $arr_data[1];
$cid = $arr_data[2];
/*$billing = getvalue("billing_type","compains",$cid);
if($billing == 'cpc' || $billing == 'both')
{
countClick($aid,"adds",$pid);
countClick($pid,"pub_adds",$pid);
}*/
$adv_ad_id = $aid;
$pub_ad_id =$pid;
countClick($adv_ad_id,$pub_ad_id);
$parenturl = $_SERVER["HTTP_REFERER"];
if( verifyLegitimateurl($parenturl,$pid) == 'Passed' && emailAlreadyExists($_SERVER['REMOTE_ADDR'],"banips","cip") == false)
{
$url = getvalue("url","adds",$aid);
header("Location: ".$url);
}
?>
而不是
header("Location: ".$url);
使用
使用ob_start()文件结尾处
之后的code>。错误是因为这一行:
header("Location: ".$url);
如果已开始写入页面,则无法重定向
如果你有这样的东西
<!Doctype html>
<?php
header("Location: ".$url);
?>
你会得到这个错误,你必须确保你没有任何html上面的php,或者你没有回声的任何东西
因此,如果将php放在顶部,则不会出现错误:
<?php
header("Location: ".$url);
?>
<!Doctype html>
当你发布问题时,指出你想做什么,而不仅仅是你面临的问题(标记为不清楚你在问什么)你的countClick()函数内容是什么?这可能会导致标题警告。
<?php
header("Location: ".$url);
?>
<!Doctype html>