提交表格后如何解决[:: 1]拒绝连接错误

时间:2019-04-12 17:46:24

标签: php forms codeigniter

我正在使用codeigniter构建博客,我遇到了一个问题,即提交表单后出现了“如何修复[:: 1]拒绝连接错误”。我尽了最大努力,但没有成功。帮助我解决该问题吗?

登录控制器

<?php

class Login_c extends MY_Controller {

    public function index() {
        $this->load->helper('form');
        $this->load->helper('html');
        $this->load->helper('url')
        $this->load->view('public/admin_login_v');
    }

    public function admin_login() {
        $this->load->helper('form');
        $this->load->helper('url')
        echo "Admin login page is reached ";


    }

admin_login_v

<div>
        <?php echo form_open('login_c/admin_login') ?>

    <?php echo form_input(['name'=>'username','placeholder'=>'Username'])?>
    <?php echo form_password( ['name'=>'password', 'placeholder'=>'password']) ?>

    <?php echo form_reset(['name'=>'cancel', 'value'=>'Cancel']),
          form_submit(['name'=>'login', 'value'=>'Login']) ?>
    </div>

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

config.php

$config['base_url'] = 'http://localhost/vi_Blog';
$config['index_page'] = 'index.php';

数据库配置文件

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'ci_blog',
    'dbdriver' => 'mysql',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

0 个答案:

没有答案