繁体   English   中英

包含标题页会话错误

[英]include header page session error

我有一个标题页,其中包含导航栏和必要的CSS,JS。

我正在尝试从联系页面调用标题页面,但是出了点问题。

我在联系页面上看到此错误。

  • 警告:session_start():无法发送会话缓存限制器-已发送的标头(输出从C:\\ xampp \\ htdocs \\ test \\ includes \\ header.php:84开始)在C:\\ xampp \\ htdocs \\ test \\ contact.php中3号线

遵循联系页面代码。

<?php include_once ("includes/config.php");
include_once ("includes/header.php");
session_start();
require_once'includes/phpmailer/security.php';
?>


<div class="container">
    <div class="contact">

        <?php if(isset($_GET['CaptchaPass'])){?>
        <div >message sent</div>
        <?php } ?>
        <?php if(isset($_GET['CaptchaFail'])){?>
        <div >message failed</div>
        <?php } ?>

        <form action="includes/contact-config.php" method="post">
            <div class="form-group">
                <label for="name">Your Name *</label>
                <input type="text" name="name" autocomplete="off" required="" class="form-control" placeholder="Enter Name"  <?php echo isset ($fields['name'])? 'value="'.e($fields['name']).'"':''?>>
            </div>
            <div class="form-group">
                <label for="email">Your Email address * </label>
                <input type="email" name="email" autocomplete="off" required=""  class="form-control" placeholder="Enter Email"<?php echo isset ($fields['email'])? 'value="'.e($fields['email']).'"':''?>>
            </div>
            <div class="form-group" >
                <label for="message">Your Message *</label>
                <textarea class="form-control" rows="8" id="comment" required=""  name="message"<?php echo isset ($fields['message'])? e($fields['message']):''?>></textarea>
                <br>
                <div class="g-recaptcha" data-sitekey="6LcyfhgUAAAAAKunkwqqxFJSOPUzYbNmppLQbcWc"></div>


                <input type="submit" value="Send" id="ContactButton" class="form-control" class="btn btn-primary">
            </div>
        </form>

    </div>
</div>
</body>

<?php include ("includes/footer.php");?>

header.php文件夹路径-> C:\\ xampp \\ htdocs \\ test \\ includes \\ header.php

contact.php文件夹路径-> C:\\ xampp \\ htdocs \\ test \\ contact.php

最可能的问题是includes/config.phpincludes/header.php正在向浏览器输出某些内容-可能是空白。

如果这些文件带有关闭的PHP标记?> ,则删除它们应该有助于解决问题。 还要确保没有文件使用echoprint或其他输出功能。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM