zoukankan      html  css  js  c++  java
  • dvwa 源码分析(三) --- config.inc.php分析

    <?php
    
    # If you are having problems connecting to the MySQL database and all of the variables below are correct
    # try changing the 'db_server' variable from localhost to 127.0.0.1. Fixes a problem due to sockets.
    # Thanks to digininja for the fix.
    
    # Database management system to use
    
    $DBMS = 'MySQL';
    #$DBMS = 'PGSQL';
    
    # Database variables
    
    $_DVWA = array();
    $_DVWA[ 'db_server' ] = 'localhost';
    $_DVWA[ 'db_database' ] = 'dvwa';
    $_DVWA[ 'db_user' ] = 'root';
    $_DVWA[ 'db_password' ] = '';
    
    # Only needed for PGSQL
    $_DVWA[ 'db_port' ] = '5432'; 
    
    ?>

    代码很简单,创建一个变量DBMS,表示使用的数据库类型,默认为MySQL。

    然后创建一个数组,数组中包含了数据库连接的相关信息,但没有定义使用的数据库名,可以看出我们只是连接到数据库,但没有选择数据库。

  • 相关阅读:
    GO开发[一]:golang语言初探
    Python带参数的装饰器
    Python函数篇
    19. logging模块
    18. json模块
    17. os模块
    16. sys模块
    15. random模块
    14. 模块-time模块
    29. java面向对象项目
  • 原文地址:https://www.cnblogs.com/tk091/p/3219972.html
Copyright © 2011-2022 走看看