English 中文(简体)
法典:A PHP 遇到过错
原标题:Codeigniter :A PHP Error was encountered

在我的法典中,这些错误是解决这一问题的错误。

A PHP Error

严重程度:警告

贺电:Cannot 更改标题信息——已经发送的负责人(投稿开始于/home/websites/public_html/application/ Controllers/user.php:64)

姓名:求助人/救援人员。

Line Number: 546

这是我的法典。

function register()
{
                     $email=$_POST[ email ];
                    $pass=$_POST[ pass ];
                     $cpass=$_POST[ cpass ];
            $valid = array(
                                    array(
                                         field    =>  email ,
                                         label    =>  Username(Email) ,
                                         rules  =>  trim|required|valid_email|is_unique[register.email] 
                                    ), 
                                    array(
                                         field    =>  pass ,
                                         label    =>  Password ,
                                         rules    =>  trim|required||matches[cpass]|min_length[8]|max_length[30]| 
                                    ),
                                    array(
                                         field    =>  cpass ,
                                         label    =>  Confirm Password ,
                                         rules    =>  trim|required 
                                    )
                            );
                $this->form_validation->set_rules($valid); 
        $this->form_validation->set_error_delimiters( <div class="error_txt"> ,  </div> );
        if ($this->form_validation->run() == FALSE)
        {
            echo "error";
            redirect( /home/ ); 
        }
        else
        {

            $this->load->model( User_model );       
            $rs=$this->User_model->register($_POST);

            redirect( /home/ ); 
        }
}
问题回答

它可能在这里发生:

重复“error”;

相反,试图将错误退回打电话者,然后从中显示错误。

不要在亚克斯电话中转机。 您可以用 j子回头实现你们的目标。 提纲:

if ($this->form_validation->run() == FALSE)
{
  echo "error";
}
else
{
  $this->load->model( User_model );       
  $rs=$this->User_model->register($_POST);
}

In JAVASCRIPT:

window.location =  <?php echo site_url( home ); ?> ;

实际向浏览器发送了<代码>Location的头盔。

你的产出已经开始。 服务器必须在任何产出开始之前发送头盔。 您在转题之前正在使用<代码>echo。 因此,它投下了一个错误,因为它在产出开始后便能够派遣头盔。

删除<代码>echo,应为您工作。





相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

What s the proper MVC way to do this....?

Quick question about general MVC design principle in PHP, using CodeIgniter or Kohana (I m actually using Kohana). I m new to MVC and don t want to get this wrong... so I m wondering if i have ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

CodeIgniter adding semicolons

How do I stop CodeIgniter adding semicolons ; to data sent via POST that contains ampersand &? For example it is converting "a=1&b=2&c=3" into "a=1&b;=2&c;=3". From looking on the forums ...

Best way to make Admin pages in CodeIgniter?

I m working on an app in CodeIgniter, and I want to have admin pages for several of the objects in the application, and I m wondering what would be the better way to put these into an MVC structure. ...

CodeIgniter form verification and class

I m using the form validation library and have something like this in the view <p> <label for="NAME">Name <span class="required">*</span></label> <?...

热门标签