PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Renato Menezes Portugal   Verify User   index.php   Download  
File: index.php
Role: Auxiliary data
Content type: text/plain
Description: Principal File
Class: Verify User
Validate user with a record in a MySQL table
Author: By
Last change: New Version
Date: 6 years ago
Size: 1,726 bytes
 

Contents

Class file image Download
<html> <head> <script type = "text/javascript" src="jquery.js" language="javascript"></script> <script language="javascript"> $(document).ready(function() { $('#retorno_campo1').load('loadVerificaCampo1.php').show(); $('#entrada_campo1').keyup(function() { $.post('loadVerificaCampo1.php', { username: form.username.value }, function(result) { $('#retorno_campo1').html(result).show(); }); }); $('#retorno_campo2').load('loadVerificaCampo2.php').show(); $('#entrada_campo2').keyup(function() { $.post('loadVerificaCampo2.php', { username2: form.username2.value }, function(result) { $('#retorno_campo2').html(result).show(); }); }); }); </script> </head> <body> <h1>VERIFICA BANCO DE DADOS</h1> <form name="form"> <table> <tr> <td> Username: <br /> <td> <input type="text" id="entrada_campo1" name="username"> <div><td id="retorno_campo1"><img src='newloader.gif'></td></div> </tr> <tr> <td> Username2: <br /> <td> <input type="text" id="entrada_campo2" name="username2"> <div><td id="retorno_campo2"><img src='newloader.gif'></td></div> </tr> </table> </form> Digite um dos nomes que estão no banco, e aparecerá o símbolo vermelho de impedimento. <h2>BANCO DE DADOS</h2> <pre> CREATE DATABASE IF NOT EXISTS `verificadb`; USE `verificadb`; CREATE TABLE `usuarios` ( `id` INT NOT NULL, `usuario` VARCHAR(200) NULL, PRIMARY KEY (`id`) ) COLLATE='latin1_general_ci' ENGINE=InnoDB ; INSERT INTO `usuarios` (`id`, `usuario`) VALUES (1, 'Renato'), (2, 'Jorge'), (3, 'Maria'), (4, 'Daniel'); </pre> <!-- <div id="feedback"> In here</div> --> </body> </html>