如何配置config.inc.php在phpmyadmin中具有loginform [英] how to configure config.inc.php to have a loginform in phpmyadmin

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

问题描述

我是否必须下载任何文件才能在php中拥有登录表单.我已经问了一百万遍了,但是我不确定你们是否知道这个问题.我只需要一个phpmyadmin中的登录表单.您将在其中输入您的用户名和密码.我是否必须创建任何php登录表单,或者在安装wampserver时是否已包含该登录表单.我已经在C:\wamp\apps\phpmyadmin3.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:\wamp\apps\phpmyadmin3.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 :

  • Using authentication modes
  • Configuration, which states (quoting) :

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

'cookie' 2.2.3中引入的身份验证模式($auth_type = 'cookie') 允许您以任何有效的身份登录 MySQL用户借助cookie.
用户名和密码已存储 在会话期间在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中具有loginform的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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