This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Se define la tarea por defecto | |
| task :default => :client | |
| desc "Socket del tipo TCP para el cliente" | |
| task :client do | |
| port = 8000 | |
| hostname = 'localhost' | |
| sh "ruby TCPClient.rb #{hostname} #{port}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #encoding: UTF-8 | |
| require 'socket' | |
| class SocketServer | |
| attr_accessor :port | |
| def initialize(port) | |
| @port = port | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #encoding: UTF-8 | |
| require 'socket' | |
| class SocketClient | |
| attr_accessor :hostname, :port | |
| def initialize(hostname, port) | |
| @hostname = hostname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Nos permite iniciar una sección en php | |
| session_start(); | |
| // Inicia sessión (la @ evita los mensajes de error si la sesión ya está iniciada) | |
| // unset($_SESSION); //eliminamos la variable con los datos de usuario; | |
| include("connection.php"); | |
| // Se requiere que los datos de contraseña y nombre no estén vacío | |
| if( isset($_POST['nombreL']) && !empty($_POST['nombreL']) && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include("connection.php"); | |
| // Sólo se requieren para los campos obligatorios del registro que no estén vacío | |
| if( isset($_POST['nombreR']) && !empty($_POST['nombreR']) && | |
| isset($_POST['usu']) && !empty($_POST['usu']) && | |
| isset($_POST['email']) && !empty($_POST['email']) && | |
| isset($_POST['pwdR']) && !empty($_POST['pwdR']) ) | |
| { | |
| // Se establece la conexión |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('SQL_SERVER','mysql5.000webhost.com'); | |
| define('SQL_USER','user'); // User | |
| define('SQL_PASS','password'); // Password | |
| define('SQL_DB','database'); // database | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HTMLForm < XMLGrammar | |
| element :form, :action => REQ, # atributo requerido | |
| :method => "GET", # cadena: valor por defecto | |
| :enctype => "application/x-www-form-urlencoded", | |
| :name => OPT # opcional | |
| element :button, :name => OPT, :value => OPT, | |
| :type => "submit", :disabled => OPT | |
| element :br | |
| end |