如何配置 config.inc.php 在 phpmyadmin 中有一个登录表单 [英] how to configure config.inc.php to have a loginform in phpmyadmin

查看:13
本文介绍了如何配置 config.inc.php 在 phpmyadmin 中有一个登录表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是否必须下载任何文件才能在 php 中有一个登录表单.我已经问过一百万次了,但我不确定你们是否得到了这个问题.我想要的只是 phpmyadmin 中的登录表单.您将在其中输入您的用户名和密码.我是否必须创建任何 php 登录表单,或者在您安装 wampserver 时是否已包含它.我已经在 C:wampappsphpmyadmin3.2.0.1 中配置了 config.inc.php .这是我不包含任何密码时的样子.我需要编辑什么?我是初学者,非常渴望拥有该登录表单,但我没有得到任何相关的答案.

Do I have to download any files in order to have a login form in php. I've asked this a million times but I'm not sure if you guys gets the question or not. All I want is a login form In phpmyadmin. Wherein you will input your username and password. DO I have to create any php login form or is it already included when you install wampserver. I've already configured the config.inc.php in C:wampappsphpmyadmin3.2.0.1 . Here is what it looks like when I don't include any password. What do I have to edit? I'm beginner and so eager to have that login form already but I don't get any relevant answers.

<?php

    /* Servers configuration */
    $i = 0;

    /* Server: localhost [1] */
    $i++;
    $cfg['Servers'][$i]['verbose'] = 'localhost';
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['port'] = '';
    $cfg['Servers'][$i]['socket'] = '';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;

    /* End of servers configuration */

    $cfg['DefaultLang'] = 'en-utf-8';
    $cfg['ServerDefault'] = 1;
    $cfg['UploadDir'] = '';
    $cfg['SaveDir'] = '';

    ?>

推荐答案

首先,你不需要自己开发任何表单:phpMyAdmin,取决于它的配置(即config.inc.php) 将显示一个身份证明表格,要求输入登录名和密码.

First of all, you do not have to develop any form yourself : phpMyAdmin, depending on its configuration (i.e. config.inc.php) will display an identification form, asking for a login and password.

要获得该表单,您不应该使用 :

To get that form, you should not use :

$cfg['Servers'][$i]['auth_type'] = 'config';

但你应该使用:

$cfg['Servers'][$i]['auth_type'] = 'cookie';

(至少,这是我在服务器上使用表单提示输入登录名/密码的内容)


有关更多信息,您可以查看文档:


For more informations, you can take a look at the documentation :

'config' 认证 ($auth_type= 'config') 是普通的旧方式:用户名和密码存储在config.inc.php.

'cookie'身份验证模式 ($auth_type ='cookie') 在 2.2.3 中引入允许您以任何有效的身份登录借助 cookie 的 MySQL 用户.
用户名和密码被存储在会话期间的 cookie 中和密码结束时删除.

'config' authentication ($auth_type = 'config') is the plain old way: username and password are stored in config.inc.php.

'cookie' authentication mode ($auth_type = 'cookie') as introduced in 2.2.3 allows you to log in as any valid MySQL user with the help of cookies.
Username and password are stored in cookies during the session and password is deleted when it ends.

这篇关于如何配置 config.inc.php 在 phpmyadmin 中有一个登录表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆