页面不重定向和显示错误无法修改标题信息

时间:2015-09-26 10:58:38

标签: php session redirect web-hosting request-headers

我用谷歌搜索了一下,但以前的问题都没有解决我的问题。我最近改变了我的托管,从那时起我收到此错误,当用户登录但设置为按标题重定向的页面,不会重定向到主页。相同的代码正在使用以前的托管合作伙伴和localhost。

  

警告:无法修改标头信息 - 已发送的标头   (输出从/home/rwrdguy/public_html/header.php:31开始)   第34行/home/rwrdguy/public_html/login.php //HEHEER.PHP

input.next().charAt(0)

// login.php中

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
    <title>100% CashBack on Shopping Online!</title>
 <meta charset="utf-8">
<meta name="author" content="Abhishek Singh">
<meta property="og:title" content="100% CashBack on Shopping Online!">
<meta property="og:type" content="Website">
<meta property="og:url" content="http://www.rewardadda.com/">
<meta property="og:image" content="http://www.rewardadda.com/images/recharged-facebook-thumb.png">
<meta property="og:description" content="100% CashBack on Shopping Online!"><meta property="og:site_name" content="Rewardadda.com-100% CashBack on Shopping Online!"><meta name="robots" content="index, follow, archive">
<meta name="description" content="How about getting free Recharges, Gift Vouchers and Bank Transfers every time you buy something, on top of existing coupons and offers?">
<meta name="keywords" content="free recharges, India, flipkart offers, offer, shopping offers, online offers, flipkart deals, amazon deals, cashback">
<link rel="icon" type="image/png" href="images/favicon.png"/>
<link href='http://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link rel="stylesheet" type="text/css" href="footer.css">
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-66870051-1', 'auto');
  ga('send', 'pageview');
</script>
</head>

1 个答案:

答案 0 :(得分:0)

因为如果你显示任何东西。即使<div id="damn"><h2>You are already logged in. Redirecting you to your HomePage.</h2></div>然后标题()也不再有效

您通常要做的是在页面的缩写中测试if(isset($_SESSION['user_id'])) header("Location /")

无需发送消息说用户“已经bla bla bla”,一旦您已经登录,就无法看到登录页面。