Guest User

Untitled

a guest
Apr 30th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2.  
  3. // This file handles the initialization logic.
  4. // It handles session control, connects to the database server and recreates the
  5. // database structure if needed.
  6.  
  7. //Start a new sesssion for this user if necessary.
  8. if(session_id()=="")
  9. {
  10. session_start();
  11. header("Cache-control: private");
  12. }
  13.  
  14. //Database connection details.
  15. $config_database_username="test";
  16. $config_database="test";
  17. $config_password="testtest";
  18.  
  19. //Connect to a database server which is on the same machine at port 3306
  20. $dbcnx = mysql_connect("127.0.0.1:3306", $config_database_username, $config_password)
  21. or die("Unable to connect to the database. <br> Please check your settings in config.php!");
  22.  
  23. //Find the desired database on the connected server.
  24. mysql_select_db($config_database) or die("Unable to select the database schemata. <br> Please check your settings in config.php!");
  25.  
  26. //See if the necessary database tables need to be reinstalled.
  27. $result = mysql_query("select * from options where optionName='installed'");
  28. if($result==0)
  29. {
  30. include "logic/logic.install.php"; //Run the install logic.
  31. }
  32.  
  33. ?>
Add Comment
Please, Sign In to add comment