Advertisement
Guest User

Untitled

a guest
Mar 7th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. ;<?php
  2. ;die(); // For further security
  3. ;/*
  4. [database]
  5. driver=mysql
  6. host=localhost
  7. port=3306
  8. schema=base
  9. username=root
  10. password=
  11. ;*/
  12.  
  13. ;<?php
  14. ;die(); // For further security
  15. ;/*
  16. [database]
  17. driver="mysql"
  18. host="localhost"
  19. port="3306"
  20. schema="base"
  21. username="root"
  22. password=""
  23. ;*/
  24.  
  25. ;<?php
  26. ;die(); // For further security
  27. ;/*[database]
  28. host="localhost"
  29. user="root"
  30. pass=""
  31. schema="base";*/
  32.  
  33. $file ='__config.ini.php';
  34.  
  35. $config=parse_ini_file($file);
  36.  
  37. $host = $config['database']['host'];
  38. echo $host;
  39. $user = $config['database']['user'];
  40. echo $user;
  41. $pass = $config['database']['pass'];
  42. echo $pass;
  43. $schema = $config['database']['schema'];
  44. echo $schema;
  45.  
  46. ;<?php
  47. ;die(); // For further security
  48. ;/*
  49. [database]
  50. driver="mysql"
  51. host="localhost"
  52. port="3306"
  53. schema="base"
  54. username="root"
  55. password=""
  56. ;*/
  57.  
  58. <?php
  59. $config=parse_ini_file($file);
  60. echo $config['driver'];
  61. echo $config['host'];
  62.  
  63. <?php
  64. $config=parse_ini_file($file, true);
  65. echo $config['database']['driver'];
  66. echo $config['database']['host'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement