Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $databasehost = 'localhost';
- $dbname = 'ist';
- $datausuario = 'root';
- $datapass = 'f';
- mysql_connect($databasehost, $datausuario, $datapass)or error("Could not connect: ".mysql_error());
- mysql_select_db($dbname) or error(mysql_error());
- $username = $_POST['username'];
- if(!empty($username)){
- $password = md5(md5($_POST['pass']));//encriptacion
- $oferta = $_POST['oferta'];
- if(!is_numeric($oferta))
- {
- die("No puede ser numerico");//prevenimos que la oferta sea letra
- }
- $seleccion = mysql_query("SELECT * FROM users WHERE username='" . mysql_real_escape_string($username) . "' AND username='$password';");
- if(!$seleccion)
- {
- die("Ha ocurrido un error al digitar el username o password");
- } else {
- $encontrado = mysql_fetch_assoc($seleccion);
- }
- $xats = $encontrado['xats'];
- echo $xats;
- }
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- Username <input type="text" name="username">
- <br>
- Password <input type="password" name="pass">
- <br>
- Tu oferta <input type="text" name="oferta"> (solo numeros)
- <center><input type="submit" name="aceptarcuenta" value="Aceptar"></center>
- </form>
Add Comment
Please, Sign In to add comment