LOGIN.JS
Código Javascript:
Fake.phpVer original
xt.QuickTips.init(); Ext.onReady(function(){ var fp = new Ext.FormPanel({ id: 'status-form', renderTo: Ext.getBody(), labelWidth: 75, frame: true, monitorValid:true, width: 350, buttonAlign: 'right', border: false, bodyStyle: 'padding:10px 10px 0;', defaults: { anchor: '95%', allowBlank: false, selectOnFocus: true, msgTarget: 'side' }, items:[{ xtype: 'textfield', fieldLabel: 'Usuario', name: 'login', minLength: 2, blankText: 'Ingrese su Usuario' },{ xtype: 'textfield', fieldLabel: 'Password', name: 'password', minLength: 2, inputType: 'password', allowBlank:false, blankText: 'Ingrese su Clave' }], buttons: [{ text: 'Ingresar', visible: false, handler: function(){ if(fp.getForm().isValid()){ var sb = Ext.getCmp('form-statusbar'); sb.showBusy('Validando...'); fp.getEl().mask(); fp.getForm().submit({ url: 'fake.php', success: function(){ sb.setStatus({ text:'Validacion Completa::::Bienvenido...!', iconCls:'', clear: true }); fp.getEl().unmask(); var redirect = "../../Main2/index.php"; window.location = redirect; } }); } } },{ text: 'Cancelar', visible: false }] }); new Ext.Panel({ title: 'Ingrese Datos', renderTo: Ext.getBody(), width: 350, autoHeight: true, layout: 'fit', items: fp, bbar: new Ext.ux.StatusBar({ id: 'form-statusbar', defaultText: 'Ingrese Datos', plugins: new Ext.ux.ValidationStatus({form:'status-form'}) }) }); });
Código PHP:
Login.phpVer original
<?php include "../../Conexion/cnx_php.php"; //obtenemos los valores de nuestro login $user = $_POST['login']; $pass = $_POST['password']; //Realiza la validacion de Usuarios if($row['login'] == $user && $row['password'] == $pass){ echo "{success:true}"; }else{ //echo "{success:false, errors: { reason: 'Password error.' }}"; echo "{success:false}"; } ?>
Código PHP:
Cnx_php.phpVer original
<?php include "../../Conexion/cnx_php.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>::::</title> <link rel="stylesheet" type="text/css" href="css/ext-all.css" /> <script type="text/javascript" src="ext-base.js"> </script> <script type="text/javascript" src="ext-all.js"> </script> <script type="text/javascript" src="StatusBar.js"> </script> <link rel="stylesheet" type="text/css" href="css/StatusBar.css" /> <script type="text/javascript" src="ValidationStatus.js"> </script> <script type="text/javascript" src="login.js"> </script> <link rel="stylesheet" type="text/css" href="css/examples.css" /> <style> .list { list-style-image:none; list-style-position:outside; list-style-type:square; padding-left:16px; } .list li { font-size:11px; padding:3px; } </style> </head> <body background="Logo2.jpg"> <table border=0 style="position:absolute;top:40px;left:40px;" width=50%> <tr> <td><img src="logo.png" /></td> <td> <div id="logo"> <h1><font color= white>Login</h1> <p>Bienvenido! Por favor inicie su sesión...</p> </div> </td> </tr> </table> <div id="form-statusbar" ></div> </body> </html>
Código PHP:
Ver original
<?php mssql_connect('E-LCCC3-7284\SQL2', 'sa', 'atent0') or die("No fue posible conectar con el servidor"); ?>