Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. <?php
  2. $database=$_POST["database"];
  3. $username=$_POST["username"];
  4. $password=$_POST["password"];
  5. $hostname=$_POST["hostname"];
  6. $ip=$_POST["ip"];
  7. $musport=$_POST["musport"];
  8. if(file_exists("usuarios/$id.txt")){
  9. echo "<script>location.href='final.php?msg=existe&volt=index.php'</script>";
  10. }
  11. else{
  12. if($database==""){
  13. echo "<script>location.href='index.php';alert('Escriba El Nombre De La Base De Datos.');</script>";
  14. }
  15. if($username==""){
  16. echo "<script>location.href='index.php';alert('Escriba El usuario De La Base De Datos.');</script>";
  17. }
  18. if($password==""){
  19. echo "<script>location.href='index.php';alert('Escriba la Contrasena De La Base De Datos.');</script>";
  20. }
  21. if($hostname==""){
  22. echo "<script>location.href='index.php';alert('Escriba El Host De La Base De Datos.');</script>";
  23. }
  24. if($ip==""){
  25. echo "<script>location.href='index.php';alert('Escriba la IP.');</script>";
  26. }
  27. if($musport==""){
  28. echo "<script>location.href='index.php';alert('Escriba el MUS Port.');</script>";
  29. }
  30. $link = @mysql_connect("$hostname","$username","$password");
  31. if (!$link) {
  32. echo("<script>location.href='index.php';alert('Error al conectar a la Base de datos, Revisa los Datos\nHost: $hostname\nUsuario: $username\nContraseña: $password');</script>");
  33. }
  34. $db_selected = mysql_select_db(''.$database.'', $link);
  35. if (!$db_selected) {
  36. echo("<script>location.href='index.php';alert('Nombre de la DB incorrecto. Revisa los datos: \nHost: $hostname\nUsuario: $username\nContraseña: $password\nNombre DB: $database');</script>");
  37. }
  38.  
  39.  
  40.  
  41. else{
  42. $salvar= "<?php
  43. /*=======================================================================
  44. | EGOCMS - Jorge40813,Juancarlos,Meth0d.
  45. | #######################################################################
  46. | EGOCMS instalador creado por Jorge40813. Por favor, no retire los créditos.
  47. | EGOCMS Instale creado por EGOCMS. Por favor, no retire los créditos.
  48. | Http: / / todomix.org
  49. |
  50. \======================================================================*/
  51.  
  52.  
  53. class MySQL
  54. {
  55. private \$connected = false;
  56. private \$hostname = \"$hostname\";
  57. private \$username = \"$username\";
  58. private \$password = \"$password\";
  59. private \$database = \"$database\";
  60. private \$link;
  61.  
  62. public function MySQL(\$host, \$user, \$pass, \$db)
  63. {
  64. \$this->connected = false;
  65. \$this->hostname = \$host;
  66. \$this->username = \$user;
  67. \$this->password = \$pass;
  68. \$this->database = \$db;
  69. }
  70.  
  71. public function IsConnected()
  72. {
  73. if (\$this->connected)
  74. {
  75. return true;
  76. }
  77.  
  78. return false;
  79. }
  80.  
  81. public function Connect()
  82. {
  83. \$this->link = mysql_connect(\$this->hostname, \$this->username, \$this->password) or \$this->error(mysql_error());
  84. mysql_select_db(\$this->database, \$this->link) or \$this->error(mysql_error());
  85.  
  86. \$this->connected = true;
  87. }
  88.  
  89. public function Disconnect()
  90. {
  91. if(\$this->connected)
  92. {
  93. @mysql_close(\$this->link) or \$this->error(\"could not close conn\");
  94. \$this->connected = false;
  95. }
  96. }
  97.  
  98. public function DoQuery(\$query)
  99. {
  100. \$resultset = @mysql_query(\$query, \$this->link) or \$this->error(mysql_error());
  101. return \$resultset;
  102. }
  103.  
  104. public function Evaluate(\$resultset)
  105. {
  106. return @mysql_result(\$resultset, 0);
  107. }
  108.  
  109. public function Error(\$errorString)
  110. {
  111. global \$core;
  112.  
  113. \$core->systemError('Database Error', \$errorString);
  114. }
  115.  
  116. public function __destruct()
  117. {
  118. \$this->disconnect();
  119. }
  120. }
  121.  
  122. ?>
  123. ";
  124. $abreid= fopen("../inc/class.db.mysql.php","w"); // Registrar El usuario
  125. fwrite($abreid,"$salvar");
  126. fclose($abreid);
  127.  
  128. $salvar2= "<?php
  129. /*=======================================================================
  130. | EGOCMS - Jorge40813,Juancarlos,Meth0d.
  131. | #######################################################################
  132. | EGOCMS instalador creado por Jorge40813. Por favor, no retire los créditos.
  133. | EGOCMS Instale creado por EGOCMS. Por favor, no retire los créditos.
  134. | Http: / / todomix.org
  135. |
  136. \======================================================================*/
  137.  
  138. \$config['Site']['www'] = \"$www\";
  139. \$config['Site']['hash_secret'] = \"xCg532%@%gdvf^5DGaa6&*rFTfg^FD4\\$OIFThrR_gh(ugf*/\";
  140.  
  141. \$config['MySQL']['hostname'] = \"$hostname\";
  142. \$config['MySQL']['username'] = \"$username\";
  143. \$config['MySQL']['password'] = \"$password\";
  144. \$config['MySQL']['database'] = \"$database\";
  145.  
  146. \$config['MUS']['enabled'] = false;
  147. \$config['MUS']['ip'] = \"$ip\";
  148. \$config['MUS']['port'] = \"$musport\";
  149.  
  150. ?>";
  151. $abreid2= fopen("../inc/inc.config.php","w");
  152.  
  153. fwrite($abreid2,"$salvar2");
  154. fclose($abreid2);
  155.  
  156. echo "<script>location.href='final.php?msg=ok'</script>";
  157. }
  158. }
  159. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement