Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. if (isset ($_POST["password"]) && isset ($_POST["username"])){
  2. $conexion=mysql_connect("localhost","ucangelsanchez","abc123.") or die ("<h3>No se ha podido establecer conexion con el servidor</h3>");
  3. $base=mysql_select_db("asi2angel",$conexion) or die ("<h3>La base de datos no se ha encontrado</h3>");
  4. $consulta=mysql_query("select * from persoas where user='" . $_POST["username"] ."'and pass='". $_POST["password"] ."'");
  5. if (mysql_num_rows($consulta)>0)
  6. {
  7. session_start();
  8. $_SESSION['username']=$_POST["username"];
  9.  
  10. ?>
  11. <script type="text/javascript">
  12. window.location="menu.php";
  13. </script>
  14. <?php
  15. }
  16.  
  17. else
  18. {
  19.  
  20. echo "<center><p>Datos de acceso incorrectos</p></center>";
  21. }
  22. }
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement