1 <?php
/*Instalador de cLab.*/?
>
2 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="es" lang
="es">
5 <meta http
-equiv
="Content-Type" content
="text/html; charset=UTF-8" />
6 <meta http
-equiv
="Content-Style-type" content
="text/css" />
7 <meta http
-equiv
="Content-Script-type" content
="text/javascript" />
8 <meta http
-equiv
="Content-Language" content
="es" />
9 <link rel
="StyleSheet" href
="estilo.css" type
="text/css" />
10 <link rel
="shortcut icon" href
="/favicon.ico" type
="image/x-icon" />
11 <link rel
="start" href
="/" />
12 <title
>Instalador de Control de Laboratorio
</title
>
16 if (!isset($_POST['instalar'])) {
18 <h3>cLab - Instalador</h3><br />
19 <form action="'. $_SERVER['PHP_SELF'] .'" method="post">
21 <tr><td>Configuración MySQL</td></tr>
23 <td>Dirección del servidor MySQL:</td>
24 <td><input type="text" name="motor" style="background-color:#FFF7DF;color:#800000" maxlength="50" size="20" value="localhost" /></td>
27 <td>Base de datos a utilizar:</td>
28 <td><input type="text" name="base" style="background-color:#FFF7DF;color:#800000" maxlength="10" size="20" value="" /></td>
32 <td><input type="text" name="usuario" style="background-color:#FFF7DF;color:#800000" maxlength="10" size="20" value="" /></td>
36 <td><input type="password" name="clave" style="background-color:#FFF7DF;color:#800000" maxlength="20" size="20" value="" /></td>
39 <tr><td><br />Administración</td></tr>
40 <td>Nombre Administrador:</td>
41 <td><input type="text" name="admin" style="background-color:#FFF7DF;color:#800000" maxlength="10" size="20" value="" /></td>
45 <td><input type="password" name="admin_clave" style="background-color:#FFF7DF;color:#800000" maxlength="20" size="20" value="" /></td>
48 <td>Clave (repetir):</td>
49 <td><input type="password" name="admin_clave2" style="background-color:#FFF7DF;color:#800000" maxlength="20" size="20" value="" /></td>
53 <input type="submit" name="instalar" value="Instalar" />
57 echo '<h3>cLab - Instalador : Instalando</h3><br />';
58 $link = @mysql_connect
($_POST['motor'], $_POST['usuario'], $_POST['clave']) or die('Por favor revise sus datos, puesto que se produjo el siguiente error:<br /><pre>' . mysql_error() . '</pre>');
59 echo 'Base de datos conectada...<br />';
60 mysql_select_db($_POST['base']) or die('!->La base de datos seleccionada "'.$_POST['base'].'" no existe');
61 $query = 'DROP TABLE IF EXISTS cLab_usr;';
62 $result = @mysql_query
($query) or die('!->No se pudo eliminar la tabla cLab_usr:<br /><pre>' . mysql_error() . '</pre>');
63 $query = 'DROP TABLE IF EXISTS cLab_usr;';
64 $result = @mysql_query
($query) or die('!->Consulta fallida:<br /><pre>' . mysql_error() . '</pre>');
68 echo 'Instalación completa<br />';