Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $database=$_POST["database"];
- $username=$_POST["username"];
- $password=$_POST["password"];
- $hostname=$_POST["hostname"];
- $ip=$_POST["ip"];
- $musport=$_POST["musport"];
- if(file_exists("usuarios/$id.txt")){
- echo "<script>location.href='final.php?msg=existe&volt=index.php'</script>";
- }
- else{
- if($database==""){
- echo "<script>location.href='index.php';alert('Escriba El Nombre De La Base De Datos.');</script>";
- }
- if($username==""){
- echo "<script>location.href='index.php';alert('Escriba El usuario De La Base De Datos.');</script>";
- }
- if($password==""){
- echo "<script>location.href='index.php';alert('Escriba la Contrasena De La Base De Datos.');</script>";
- }
- if($hostname==""){
- echo "<script>location.href='index.php';alert('Escriba El Host De La Base De Datos.');</script>";
- }
- if($ip==""){
- echo "<script>location.href='index.php';alert('Escriba la IP.');</script>";
- }
- if($musport==""){
- echo "<script>location.href='index.php';alert('Escriba el MUS Port.');</script>";
- }
- $link = @mysql_connect("$hostname","$username","$password");
- if (!$link) {
- 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>");
- }
- $db_selected = mysql_select_db(''.$database.'', $link);
- if (!$db_selected) {
- 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>");
- }
- else{
- $salvar= "<?php
- /*=======================================================================
- | EGOCMS - Jorge40813,Juancarlos,Meth0d.
- | #######################################################################
- | EGOCMS instalador creado por Jorge40813. Por favor, no retire los créditos.
- | EGOCMS Instale creado por EGOCMS. Por favor, no retire los créditos.
- | Http: / / todomix.org
- |
- \======================================================================*/
- class MySQL
- {
- private \$connected = false;
- private \$hostname = \"$hostname\";
- private \$username = \"$username\";
- private \$password = \"$password\";
- private \$database = \"$database\";
- private \$link;
- public function MySQL(\$host, \$user, \$pass, \$db)
- {
- \$this->connected = false;
- \$this->hostname = \$host;
- \$this->username = \$user;
- \$this->password = \$pass;
- \$this->database = \$db;
- }
- public function IsConnected()
- {
- if (\$this->connected)
- {
- return true;
- }
- return false;
- }
- public function Connect()
- {
- \$this->link = mysql_connect(\$this->hostname, \$this->username, \$this->password) or \$this->error(mysql_error());
- mysql_select_db(\$this->database, \$this->link) or \$this->error(mysql_error());
- \$this->connected = true;
- }
- public function Disconnect()
- {
- if(\$this->connected)
- {
- @mysql_close(\$this->link) or \$this->error(\"could not close conn\");
- \$this->connected = false;
- }
- }
- public function DoQuery(\$query)
- {
- \$resultset = @mysql_query(\$query, \$this->link) or \$this->error(mysql_error());
- return \$resultset;
- }
- public function Evaluate(\$resultset)
- {
- return @mysql_result(\$resultset, 0);
- }
- public function Error(\$errorString)
- {
- global \$core;
- \$core->systemError('Database Error', \$errorString);
- }
- public function __destruct()
- {
- \$this->disconnect();
- }
- }
- ?>
- ";
- $abreid= fopen("../inc/class.db.mysql.php","w"); // Registrar El usuario
- fwrite($abreid,"$salvar");
- fclose($abreid);
- $salvar2= "<?php
- /*=======================================================================
- | EGOCMS - Jorge40813,Juancarlos,Meth0d.
- | #######################################################################
- | EGOCMS instalador creado por Jorge40813. Por favor, no retire los créditos.
- | EGOCMS Instale creado por EGOCMS. Por favor, no retire los créditos.
- | Http: / / todomix.org
- |
- \======================================================================*/
- \$config['Site']['www'] = \"$www\";
- \$config['Site']['hash_secret'] = \"xCg532%@%gdvf^5DGaa6&*rFTfg^FD4\\$OIFThrR_gh(ugf*/\";
- \$config['MySQL']['hostname'] = \"$hostname\";
- \$config['MySQL']['username'] = \"$username\";
- \$config['MySQL']['password'] = \"$password\";
- \$config['MySQL']['database'] = \"$database\";
- \$config['MUS']['enabled'] = false;
- \$config['MUS']['ip'] = \"$ip\";
- \$config['MUS']['port'] = \"$musport\";
- ?>";
- $abreid2= fopen("../inc/inc.config.php","w");
- fwrite($abreid2,"$salvar2");
- fclose($abreid2);
- echo "<script>location.href='final.php?msg=ok'</script>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement