我遇到了遇到PHP错误

时间:2017-03-12 04:10:18

标签: database timer countdown suspend

当我尝试访问我的网站会员登录区域时,我遇到了之前不存在的多个错误 请帮我看一下。

  

遇到PHP错误

     

严重性:注意

     

消息:未定义的变量:数字

     

文件名:controllers / Site.php

     

行号:42

     

回溯:

     

文件:   /home/internetsunivers/2xcash.internetsuniversity.com/application/controllers/Site.php   行:42功能:_error_handler

     

文件:/home/internetsunivers/2xcash.internetsuniversity.com/index.php   行:315函数:require_once遇到PHP错误

     

严重性:警告

     

消息:无法修改标头信息 - 已发送的标头   (输出始于   /home/internetsunivers/2xcash.internetsuniversity.com/system/core/Exceptions.php:271)

     

文件名:helpers / url_helper.php

     

行号:564

     

回溯:

     

文件:   /home/internetsunivers/2xcash.internetsuniversity.com/application/controllers/Site.php   行:50功能:重定向

     

文件:/home/internetsunivers/2xcash.internetsuniversity.com/index.php   行:315功能:require_once

以下是site.php中的代码

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Site extends MY_Controller {

public function index()
{
    $this->header(':::SONNY SERVER:::');
    $data['site_name'] = $this->site_name;
    $this->load->view('home');
    $this->footer();
}

public function about() {
    $this->header('About | '.$this->site_name);
    $data['site_name'] = $this->site_name;
    $this->load->view('about');
    $this->footer();
}

public function faq() {
    $this->header('FAQ | '.$this->site_name);
    $data['site_name'] = $this->site_name;
    $this->load->view('faq');
    $this->footer();
}
public function support() {
    $this->header('Contact Support | '.$this->site_name);
    $data['site_name'] = $this->site_name;
    $this->load->view('support');
    $this->footer();
}

public function login() {

    $this->header('Login');
    $this->form_validation->set_rules('number', 'Phone Number', 'required');
    $this->form_validation->set_rules('password', 'Password', 'required');

    if ($this->form_validation->run()) {
        if ($this->core_model->login()) {
            $query = $this->db->get_where('users', array('number' => $number));
            $result = $query->row_array();

            $name = $result['name'];
            $bank_details = $result['bank_details'];
            $session_data = array('number' => $_POST['number'], 'loggedin' => TRUE, 'name' => $name);
            $this->session->set_userdata($session_data);

            redirect(site_url('dash'));

        }
        elseif ($this->db->get_where('users', array('number' => $this->input->post('number'), 'is_blocked' => 'true'))->num_rows() > 0) {
            $this->session->set_flashdata('error', 'Account has been blocked, contact suppport');
        } else {
            $this->session->set_flashdata('error', 'Login failed');

        }

        $this->load->view('login');

    } else {

        $this->load->view('login');

    }
}

public function register() {
    $this->header('Register | '.$this->site_name);
    $data['site_name'] = $this->site_name;
    $this->form_validation->set_rules('name', 'Fullname', 'required');
    $this->form_validation->set_rules('number', 'Phone Number', 'required');
    $this->form_validation->set_rules('location', 'Location', 'required');
    $this->form_validation->set_rules('bundle', 'Bundle', 'required');
    $this->form_validation->set_rules('bank_details', 'Bank Details', 'required');
    $this->form_validation->set_rules('password', 'Password', 'required');
    $this->form_validation->set_rules('c_password', 'Confirm Password', 'required|matches[password]');
    if($this->form_validation->run()) {
    $this->core_model->register();
    //register session
    $session_data = array('number' => $_POST['number'], 'loggedin' => TRUE, 'name' => $_POST['name'], 'bank_details' => $_POST['bank_details']);
    $this->session->set_userdata($session_data);
    $this->session->set_flashdata('msg2', 'Successfully registered');
    redirect(site_url('spillover'));
    $this->load->view('register');
} else {
    $this->load->view('register');
}
    $this->footer();
}

public function logout() {

    $data = array('number', 'loggedin', 'name');
    $this->session->unset_userdata($data);

    redirect('login');
}
}

0 个答案:

没有答案