我正在使用標題重定向,但它似乎並沒有爲我工作,它是在它突然停止之前。我搜索了它,發現已經發送的頭文件可能是這些頭文件的一個可能原因。我嘗試了一些解決方案,但他們都沒有爲我工作。這裏的初始代碼(這是不完整的代碼,因爲我的錯誤是,直到這個代碼的結束,而不是事後)標題重定向錯誤,由於標題已發送在線
<?php ini_set('display_errors',1);error_reporting(E_ALL);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
var price="";
var check=new Array();
</script>
<style>
<!--code for removing spinner-->
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance:textfield;
}
<!--code for removing spinner-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Cart</title>
<link rel="stylesheet" type="text/css" href="engine1/style.css" />
<link rel="stylesheet" href="css/bootstrap.css" />
<link rel="stylesheet" href="css/mystyle.css" />
<link rel="stylesheet" href="css/responsive.css" />
<script type="text/javascript" src="engine1/jquery.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
</head>
<body class="loading">
<div class="wrapper">
<?php $pagename="cart";
include("inc/header.php"); ?>
<div class="faq-bg cartbg">
<h1>Your cart</h1>
</div>
<?php
/////////////////////////db is initialized in this class manually
//session_start();
unset($_SESSION['address1-session']);
unset($_SESSION['address1-2-session']);
unset($_SESSION['city1-session']);
unset($_SESSION['state1-session']);
unset($_SESSION['postalcode1-session']);
unset($_SESSION['address2-session']);
unset($_SESSION['address2-2-session']);
unset($_SESSION['city2-session']);
unset($_SESSION['state2-session']);
unset($_SESSION['postalcode2-session']);
unset($_SESSION['puppy_name-session']);
unset($_SESSION['puppydate-session']);
unset($_SESSION['error']);
unset($_SESSION['flag']);
unset($_SESSION['unique_id']);
unset($_SESSION['flagshipping']);
//unset($_SESSION['sess_user']);
unset($_SESSION['quantity']);
unset($_SESSION['bundleplan']);
unset($_SESSION['dogsize']);
unset($_SESSION['extrapuppy']);
unset($_SESSION['toycount']);
這裏是我的工作,所以你可以看到錯誤的項目url。
可能的[如何修復]已經發送的頭文件「PHP中的錯誤」的副本(http://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php) –
我已經研究過這個網址之前,我已經刪除了很多與我的相關的問題,但它仍然給我那個錯誤 – uneeb
我有,但沒有一個似乎是我的工作 – uneeb