【发布时间】:2012-01-13 08:07:10
【问题描述】:
可能重复:
“Warning: Cannot modify header information - headers already sent by” error
在构建登录表单以插入 wordpress 系统时,尽管工作较早,但突然之间。忽略这些错误中的明星他们只是为了避免在网站上公开展示。
Warning: Cannot modify header information - headers already sent by (output started at /home/divethe1/public_html/**********.com/wp-content/themes/RIKsoft/header.php:2) in /home/divethe1/public_html/********.com/wp-includes/pluggable.php on line 738
法典上说这是开闭前后的空格造成的,但没有。违规行,即。我可以删除的一个是$user = wp_signon( $creds, false );,以使其不会导致此错误,但是它不会按照我的意愿执行。
代码
<?php get_header(); ?>
<?php
$creds = array();
$creds['user_login'] = $_POST['LOGuser'];
$creds['user_password'] = $_POST['LOGpass'];
$creds['remember'] = true;
$user = wp_signon( $creds, false );
if ( is_wp_error($user) )
echo $user->get_error_message();
?>
<?php if ( is_user_logged_in() ) { wp_redirect( $_POST['redirect'] ); exit; }
else { ?>
<div class="panel log autoc">
<div class="title"><b>LOG IN</b></div>
<form action="http://www.robin-knight.com/access/" method="post">
<label>Email Address<input name="LOGuser" type="text"></label>
<label>Password<input name="LOGpass" type="password"></label>
<input type="submit" class="button" value="Log In">
</form>
</div>
<?php }?>
<?php get_footer();?>
【问题讨论】: